Working on redirect/connect/etc

This commit is contained in:
2026-06-05 17:52:46 -04:00
parent 8a46788512
commit 8d88c88fa0
5 changed files with 117 additions and 106 deletions

View File

@@ -78,16 +78,6 @@ public:
//
PrintBuffer print_buffer_;
// Can-Be-Controlled flag.
//
// This flag indicates whether the tangible can be controlled
// by a client. Clients will not be allowed to attach to tangibles
// who don't have this flag. If this flag is true, the
// tangible cannot be deleted using a mere 'tangible.delete', instead,
// you have to use 'tangible.deleteplayer'.
//
bool can_be_controlled_;
// Is Controlled Flag.
//
// This flag is set to true when a client is controlling this player.
@@ -97,13 +87,6 @@ public:
//
bool is_controlled_;
// Force disconnect flag.
//
// This flag is used to force the client to log out ASAP. This flag
// can only be set in master models.
//
bool force_disconnect_;
// Delete on Logout Flag.
//
// This flag can be set on a controlled player. When the player
@@ -411,33 +394,50 @@ public:
// Connection Management
//
//////////////////////////////////////////////////////////////////////////
// Prepare a tangible to be controlled.
//
// This does whatever initialization is necessary to turn an ordinary
// tangible into a player-controlled tangible.
//
void connection_prepare(Tangible *tan);
// Create a connection.
//
// This creates a login actor, and also records the existence of
// the connection. Returns the actor_id of the login actor, which
// is also the client id.
// This is used by the DrivenEngine to create the login
// actor. It also records the existence of the
// connection. Returns the actor_id of the login actor,
// which is also the client id.
//
int64_t connection_create();
// This is to be called after a client disconnects. This removes the
// connection. On error, return an error message.
// Delete a connection.
//
// This is used by the DrivenEngine to report that the specified
// client has been disconnected.
//
eng::string connection_delete(int64_t client_id);
void connection_delete(int64_t client_id);
// Get the current client_id for an actor_id.
// Returns 0 if the actor is not a connected actor.
//
int64_t connection_get_client(int64_t actor_id) const;
// Get the current actor_id for a client_id.
// Returns 0 if the client_id is not a connected client.
// Find out what actor the given client is controlling.
//
// This is used by the DrivenEngine to check if the given client has
// changed actor, or if it has been forced to disconnect.
//
int64_t connection_get_actor(int64_t client_id) const;
// Add a redirect. On error, return an error message.
// Connection get client.
//
eng::string connection_redirect(int64_t client_id, int64_t actor_id);
// Get the ID of the client that is controlling the specified actor.
//
int64_t connection_get_client(Tangible *tan) const;
// Connection redirection.
//
// This is used by lua code to force changes in connection status.
// It can be used to redirect a client, or disconnect a client
// if actor2 == nullptr.
//
eng::string connection_redirect(Tangible *actor1, Tangible *actor2);
// Close all connections.
//