diff options
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r-- | src/core/gameconnection.cc | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index 982ac7d..dee506a 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -23,9 +23,6 @@ GameConnection::GameConnection(std::string const &connectionstr) { connection_instance = this; connection_network = 0; - connection_running = false; - - connection_timestamp = 0; connection_netframe = 0; unsigned int port = DEFAULTPORT; @@ -85,7 +82,8 @@ GameConnection::GameConnection(std::string const &connectionstr) } } - connection_running = true; + set_interactive(true); + set_running(true); } GameConnection::~GameConnection() @@ -98,22 +96,6 @@ GameConnection::~GameConnection() connection_instance = 0; } - -unsigned long GameConnection::timestamp() const -{ - return connection_timestamp; -} - -float GameConnection::time() const -{ - return ((float)(connection_timestamp) / 1000.0f); -} - -bool GameConnection::interactive() const -{ - return true; -} - Info *GameConnection::request_info(const unsigned int id) { if (!id) { @@ -127,7 +109,7 @@ Info *GameConnection::request_info(const unsigned int id) info = new Info(id); } - if (info->type() || (connection_timestamp < info->timestamp() + INFOTIMEOUT) ) + if (info->type() || (timestamp() < info->timestamp() + INFOTIMEOUT) ) return info; // send an information request to the server @@ -155,11 +137,6 @@ Inventory *GameConnection::request_inventory(Entity *entity) return (entity->inventory()); } - -void GameConnection::abort() -{ - connection_running = false; -} void GameConnection::forward(std::string const &cmdline) { @@ -232,7 +209,8 @@ void GameConnection::frame(unsigned long timestamp) } } - connection_timestamp = connection_network->timestamp(); + set_timestamp(connection_network->timestamp()); + connection_network->transmit(); } |