Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-02-04 13:23:05 +0000
committerStijn Buys <ingar@osirion.org>2011-02-04 13:23:05 +0000
commita69521970793424754421c8a5fba2eb465e817e6 (patch)
treef44f178a27f621f0f11ed5959418d83ee399ffcd /src/core/gameconnection.cc
parent7129e31075e021112ba6a859af29513e69671626 (diff)
Made time(), timestamp() and related methods non-virtual, corrects a crash when
the dedicated server quits.
Diffstat (limited to 'src/core/gameconnection.cc')
-rw-r--r--src/core/gameconnection.cc32
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();
}