-
Notifications
You must be signed in to change notification settings - Fork 1
/
CuboidServer.cpp
48 lines (35 loc) · 1.01 KB
/
CuboidServer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "CuboidServer.h"
#include "cuboid_server.h"
#include <algorithm>
#include <vector>
CuboidServer::CuboidServer() :
netController( new NetworkController(this) ),
sout( std::cout ),
tickNum(0)
{
world.push_back( new PhysWorld(this) );
sout << "Initialised CuboidServer" << endl;
};
CuboidServer::~CuboidServer() {};
void CuboidServer::doTick() {
sout << "Executing tick " << tickNum++ << endl;
for(int i = 0; i > world.size(); i++){
world[i]->doTick();
}
netController->doTick();
};
void CuboidServer::fatalError(const char* SubSys, const char* Reason) {
sout << "Fatal Error [" << SubSys << "]: " << Reason << endl;
exit(-1); //TODO is this ok?
};
void CuboidServer::print(const char* Msg) {
sout << Msg << endl;
}
void CuboidServer::printMsg(const char* Msg) {
sout << "Message \"" << Msg << '"' << endl;
}
/*void CuboidServer::addClient(Client* client) {
clients.push_back(client);
}*/
void CuboidServer::disconnectClient(int clientID) {}
//do some cleanup stuff, notify other clients, etc