Changed my mind about networking system structure
This commit is contained in:
+5
-5
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user