From 4e5343ce9aa83a5c0b04bf744dd287fb56ff39fc Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 1 May 2008 16:02:51 +0000 Subject: various silly fixes --- src/core/entity.h | 3 +++ src/core/gameconnection.cc | 22 +++++----------------- src/core/netserver.cc | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) (limited to 'src/core') diff --git a/src/core/entity.h b/src/core/entity.h index 46dd36c..05ca641 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -32,6 +32,9 @@ public: /// Entity flags enum Flags {Static=1, Solid=2, Bright=4}; + /// Entity render state flags + enum State {InRange=1, InCloseRange=2}; + /// Entity type constants enum Type {Default=0, Dynamic=1, Controlable=2, Globe=3}; diff --git a/src/core/gameconnection.cc b/src/core/gameconnection.cc index 923d9a3..4f410d5 100644 --- a/src/core/gameconnection.cc +++ b/src/core/gameconnection.cc @@ -88,29 +88,18 @@ void GameConnection::frame(float seconds) return; } - + connection_frametime += seconds; + float f = 0; - if (core::Cvar::sv_framerate->value()) { - connection_frametime += seconds; + if (core::Cvar::sv_framerate->value()) { f = 1.0f / core::Cvar::sv_framerate->value(); if (connection_frametime < f) { - /* - // run client prediction - std::map::iterator it; - for (it=Entity::registry.begin(); it != Entity::registry.end(); it++) { - Entity *entity = (*it).second; - if ((entity->type() == Entity::Controlable) || (entity->type() == Entity::Dynamic)) { - entity->frame(seconds); - } - } - */ return; } - } else { - connection_frametime = seconds; } - + connection_network->frame(connection_frametime); + connection_frametime = 0; if (localcontrol() && localcontrol()->dirty()) { std::ostringstream netmsg; @@ -135,7 +124,6 @@ void GameConnection::frame(float seconds) } connection_network->transmit(); - connection_frametime += f; } } diff --git a/src/core/netserver.cc b/src/core/netserver.cc index 064229b..50702ac 100644 --- a/src/core/netserver.cc +++ b/src/core/netserver.cc @@ -178,7 +178,7 @@ void NetServer::receive() timeval timeout; timeout.tv_sec = 0; - timeout.tv_usec = 25000; + timeout.tv_usec = 500; fd_set readset = serverset; int nb = select(fd()+1, &readset, NULL, NULL, &timeout); -- cgit v1.2.3