Changed my mind about networking system structure

This commit is contained in:
Kayne Ruse
2013-05-04 14:00:30 +10:00
parent 2dedfa9505
commit f0d4ef0675
8 changed files with 61 additions and 105 deletions
+5 -5
View File
@@ -21,7 +21,6 @@ void Server::Init() {
if (SDLNet_Init()) {
throw(runtime_error("Failed to init SDL_net"));
}
netMgr.Init(config.Integer("port"), config.Integer("maxplayers"));
}
void Server::Proc() {
@@ -36,21 +35,22 @@ void Server::Proc() {
}
void Server::Quit() {
netMgr.Quit();
SDLNet_Quit();
}
void Server::HandleInput() {
//accept new connections
netMgr.AcceptConnections();
//...
//accept updates from the clients
netMgr.CheckSockets();
//...
//read the updates from the clients into internal containers
//...
}
void Server::UpdateWorld() {
//update internals
//update internals ie.
// ai
// loot drops
}
void Server::HandleOutput() {