Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-01 16:02:51 +0000
committerStijn Buys <ingar@osirion.org>2008-05-01 16:02:51 +0000
commit4e5343ce9aa83a5c0b04bf744dd287fb56ff39fc (patch)
tree2f5944d3426529a973e78137f8ce5a9a29a7c54f /src/core
parentf5266b403c50cb2b6d712e6d8f41b62ad2433efb (diff)
various silly fixes
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.h3
-rw-r--r--src/core/gameconnection.cc22
-rw-r--r--src/core/netserver.cc2
3 files changed, 9 insertions, 18 deletions
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<unsigned int, Entity *>::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);