Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-14 18:04:25 +0000
committerStijn Buys <ingar@osirion.org>2008-02-14 18:04:25 +0000
commit715d0c3952a3a1d59b64074e472d0a9a3b414351 (patch)
treea5d0ddd0613caaf4f9fe01f9a3bd34e823651ad5 /src/game
parent83e8023c5e46635753a609329cf9805a3520001e (diff)
dedicated server accepts incoming connections
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Makefile.am2
-rw-r--r--src/game/game.cc11
-rw-r--r--src/game/game.h6
-rw-r--r--src/game/player.h27
4 files changed, 17 insertions, 29 deletions
diff --git a/src/game/Makefile.am b/src/game/Makefile.am
index f86c814..d327706 100644
--- a/src/game/Makefile.am
+++ b/src/game/Makefile.am
@@ -5,4 +5,4 @@ libgame_la_LDFLAGS = -avoid-version
libgame_la_SOURCES = game.cc sector.cc ship.cc shipspecs.cc star.cc
noinst_LTLIBRARIES = libgame.la
-noinst_HEADERS = game.h player.h sector.h ship.h shipspecs.h star.h world.h
+noinst_HEADERS = game.h sector.h ship.h shipspecs.h star.h world.h
diff --git a/src/game/game.cc b/src/game/game.cc
index f88c753..f8452f7 100644
--- a/src/game/game.cc
+++ b/src/game/game.cc
@@ -186,10 +186,19 @@ void Game::shutdown()
void Game::frame(float seconds)
{
-
}
+void Game::player_connect(core::Player &player)
+{
+ std::stringstream args;
+ game::func_spectate(player, args);
+}
+void Game::player_disconnect(core::Player &player)
+{
+ std::stringstream args;
+ game::func_spectate(player, args);
+}
} // namespace game
diff --git a/src/game/game.h b/src/game/game.h
index d8a6185..3811a06 100644
--- a/src/game/game.h
+++ b/src/game/game.h
@@ -36,6 +36,12 @@ public:
/// execute one game grame
void frame(float seconds);
+ /// is called when a player connects
+ void player_connect(core::Player &player);
+
+ /// is called when a player disconnects
+ void player_disconnect(core::Player &player);
+
/// sectors in space
std::vector<Sector*> sectors;
diff --git a/src/game/player.h b/src/game/player.h
deleted file mode 100644
index 0fdec76..0000000
--- a/src/game/player.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- game/player.h
- This file is part of the Osirion project and is distributed under
- the terms and conditions of the GNU General Public License version 2
-*/
-
-#ifndef __INCLUDED_GAME_PLAYER_H__
-#define __INCLUDED_GAME_PLAYER_H__
-
-#include <string>
-
-namespace game {
-
-/// a player in the game
-class Player {
-public:
- Player();
- ~Player();
-
- /// name of the player
- std::string name;
-};
-
-} // namespace game
-
-#endif // __INCLUDED_GAME_PLAYER_H__
-