Wrapper completed & tested; adjusted many systems
This commit is contained in:
+10
-2
@@ -6,7 +6,11 @@
|
||||
using namespace std;
|
||||
|
||||
void Server::Init() {
|
||||
if (SDLNet_Init()) {
|
||||
throw(runtime_error("Failed to initialize SDL_net"));
|
||||
}
|
||||
config.Load("config.cfg");
|
||||
netUtil.Open(config.Integer("port"), 512);
|
||||
running = true;
|
||||
}
|
||||
|
||||
@@ -17,15 +21,19 @@ void Server::Proc() {
|
||||
HandleOutput();
|
||||
|
||||
//debug
|
||||
running = false;
|
||||
// running = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Server::Quit() {
|
||||
//
|
||||
netUtil.Close();
|
||||
SDLNet_Quit();
|
||||
}
|
||||
|
||||
void Server::HandleInput() {
|
||||
while(netUtil.Receive()) {
|
||||
cout << reinterpret_cast<char*>(netUtil.GetInData()) << endl;
|
||||
}
|
||||
//accept new connections
|
||||
//accept updates from the clients
|
||||
//read the updates from the clients into internal containers
|
||||
|
||||
Reference in New Issue
Block a user