diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-05-14 16:47:52 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-05-14 16:47:52 +0000 |
commit | 99c97f75e2b93ea2cb36f126cd75b298bda5f5a9 (patch) | |
tree | 3ad904f3cfb78513f81241d2985b89dd1c034423 /src/main.cpp | |
parent | 0125cb14a9a4f4ffced61ba50412f13fe00adbb4 (diff) | |
download | manaserv-99c97f75e2b93ea2cb36f126cd75b298bda5f5a9.tar.gz manaserv-99c97f75e2b93ea2cb36f126cd75b298bda5f5a9.tar.bz2 manaserv-99c97f75e2b93ea2cb36f126cd75b298bda5f5a9.tar.xz manaserv-99c97f75e2b93ea2cb36f126cd75b298bda5f5a9.zip |
Applied a patch by Guillaume that makes the server sleep between ticks instead
of polling for the next one. Somebody will need to verify that this works for
on Dev-C++ as well.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 22ac6a2a..db594c76 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -319,7 +319,7 @@ void parseOptions(int argc, char *argv[]) int main(int argc, char *argv[]) { int elapsedWorldTicks; - + LOG_INFO("The Mana World Server v" << PACKAGE_VERSION, 0) // Parse Command Line Options @@ -402,11 +402,7 @@ int main(int argc, char *argv[]) // - Update all active objects/beings state.update(*connectionHandler); } - else { - // when there is nothing to do give away some processor time to - // other tasks - sched_yield(); - }; + worldTimer.sleep(); /*ENetEvent netEvent; @@ -442,13 +438,13 @@ int main(int argc, char *argv[]) enet_packet_destroy(netEvent.packet); } break; - + case ENET_EVENT_TYPE_DISCONNECT: printf("%s disconected.\n", netEvent.peer->data); netEvent.peer->data = NULL; break; - + default: printf("Unhandled enet event\n"); break; |