Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/main.cc')
-rw-r--r--src/server/main.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/server/main.cc b/src/server/main.cc
new file mode 100644
index 0000000..3ce5197
--- /dev/null
+++ b/src/server/main.cc
@@ -0,0 +1,40 @@
+/* server/main.cc
+ This file is part of the Osirion project and is distributed under
+ the terms and conditions of the GNU General Public License version 2
+*/
+
+// C++ headers
+#include <iostream>
+
+// project headers
+#include "osirion.h"
+
+#include "game/game.h"
+#include "timer.h"
+
+void quit(int status)
+{
+ exit(status);
+}
+
+int main( int argc, char *argv[] )
+{
+ const float server_framerate = 1.0f / 20.0f;
+ std::cout << "The Osirion project " << OSIRION_VERSION << std::endl;
+ Timer timer;
+
+ // initialize game
+ game::init();
+ timer.mark();
+
+ while(game::initialized) {
+ float elapsed = timer.elapsed();
+ game::update(elapsed);
+ timer.sleep(server_framerate - elapsed);
+ timer.mark();
+ }
+ // shutdown
+ game::shutdown();
+
+ quit(0);
+}