diff --git a/Code/Game/GameClient/GameClient.vcxproj.user b/Code/Game/GameClient/GameClient.vcxproj.user index 4b847ee6..2e28d6f7 100644 --- a/Code/Game/GameClient/GameClient.vcxproj.user +++ b/Code/Game/GameClient/GameClient.vcxproj.user @@ -1,7 +1,7 @@  - false + true $(OutDir) diff --git a/Code/Game/GameLogic/GameLogic.vcxproj.user b/Code/Game/GameLogic/GameLogic.vcxproj.user index 2e28d6f7..4b847ee6 100644 --- a/Code/Game/GameLogic/GameLogic.vcxproj.user +++ b/Code/Game/GameLogic/GameLogic.vcxproj.user @@ -1,7 +1,7 @@  - true + false $(OutDir) diff --git a/Code/Game/GameProtocols/ObjectProtocols.h b/Code/Game/GameProtocols/ObjectProtocols.h index 70e24883..e3449022 100644 --- a/Code/Game/GameProtocols/ObjectProtocols.h +++ b/Code/Game/GameProtocols/ObjectProtocols.h @@ -476,7 +476,21 @@ namespace GameLogic } Protocol_ObjectCreate( Oyster::Network::CustomNetProtocol& p ) { - /** @todo TODO: not implemented */ + this->object_ID = p[1].value.netInt; + this->name.assign(p[2].value.netCharPtr); + + this->position[0] = p[3].value.netFloat; + this->position[1] = p[4].value.netFloat; + this->position[2] = p[5].value.netFloat; + + this->rotationQ[0] = p[6].value.netFloat; + this->rotationQ[1] = p[7].value.netFloat; + this->rotationQ[2] = p[8].value.netFloat; + this->rotationQ[3] = p[9].value.netFloat; + + this->scale[0] = p[10].value.netFloat; + this->scale[1] = p[11].value.netFloat; + this->scale[2] = p[12].value.netFloat; } Protocol_ObjectCreate(float p[3], float r[4], float s[3], int id, char *path) { @@ -538,7 +552,7 @@ namespace GameLogic std::string name; std::string meshName; float position[3]; - float rotation[3]; + float rotationQ[4]; float scale[3]; Protocol_ObjectCreatePlayer() @@ -569,9 +583,25 @@ namespace GameLogic } Protocol_ObjectCreatePlayer(Oyster::Network::CustomNetProtocol& p) { + this->object_ID = p[1].value.netInt; + this->teamId = this->protocol[2].value.netInt; + this->name.assign(p[3].value.netCharPtr); + this->meshName.assign(p[4].value.netCharPtr); + + this->position[0] = p[5].value.netFloat; + this->position[1] = p[6].value.netFloat; + this->position[2] = p[7].value.netFloat; + this->rotationQ[0] = p[8].value.netFloat; + this->rotationQ[1] = p[9].value.netFloat; + this->rotationQ[2] = p[10].value.netFloat; + this->rotationQ[3] = p[11].value.netFloat; + + this->scale[0] = p[12].value.netFloat; + this->scale[1] = p[13].value.netFloat; + this->scale[2] = p[14].value.netFloat; } - Protocol_ObjectCreatePlayer(float position[3], float rotation[3], float scale[3], int ObjectID, int teamID, std::string name, std::string meshName) + Protocol_ObjectCreatePlayer(float position[3], float rotation[4], float scale[3], int ObjectID, int teamID, std::string name, std::string meshName) { this->protocol[0].value = protocol_Gameplay_ObjectCreatePlayer; this->protocol[0].type = Oyster::Network::NetAttributeType_Short; @@ -592,17 +622,18 @@ namespace GameLogic this->protocol[8].type = Oyster::Network::NetAttributeType_Float; this->protocol[9].type = Oyster::Network::NetAttributeType_Float; this->protocol[10].type = Oyster::Network::NetAttributeType_Float; - //SCALE this->protocol[11].type = Oyster::Network::NetAttributeType_Float; + //SCALE this->protocol[12].type = Oyster::Network::NetAttributeType_Float; this->protocol[13].type = Oyster::Network::NetAttributeType_Float; + this->protocol[14].type = Oyster::Network::NetAttributeType_Float; this->object_ID = ObjectID; this->teamId = teamID; this->name = name; this->meshName = meshName; memcpy(&this->position[0], &position[0], sizeof(float)*3); - memcpy(&this->rotation[0], &rotation[0], sizeof(float)*3); + memcpy(&this->rotationQ[0], &rotation[0], sizeof(float)*4); memcpy(&this->scale[0], &scale[0], sizeof(float)*3); } Oyster::Network::CustomNetProtocol GetProtocol() override @@ -618,13 +649,14 @@ namespace GameLogic this->protocol[6].value = this->position[1]; this->protocol[7].value = this->position[2]; //ROTATION - this->protocol[8].value = this->rotation[0]; - this->protocol[9].value = this->rotation[1]; - this->protocol[10].value = this->rotation[2]; + this->protocol[8].value = this->rotationQ[0]; + this->protocol[9].value = this->rotationQ[1]; + this->protocol[10].value = this->rotationQ[2]; + this->protocol[11].value = this->rotationQ[3]; //SCALE - this->protocol[11].value = this->scale[0]; - this->protocol[12].value = this->scale[1]; - this->protocol[13].value = this->scale[2]; + this->protocol[12].value = this->scale[0]; + this->protocol[13].value = this->scale[1]; + this->protocol[14].value = this->scale[2]; return protocol; } diff --git a/Code/Game/GameServer/Implementation/GameLobby.cpp b/Code/Game/GameServer/Implementation/GameLobby.cpp index 1b8b63ec..82599677 100644 --- a/Code/Game/GameServer/Implementation/GameLobby.cpp +++ b/Code/Game/GameServer/Implementation/GameLobby.cpp @@ -15,18 +15,15 @@ namespace DanBias { GameLobby::GameLobby() { } - GameLobby::~GameLobby() { this->clients.Clear(); } - void GameLobby::Release() { NetworkSession::CloseSession(true); this->gameSession.CloseSession(true); } - void GameLobby::Update() { this->ProcessClients(); diff --git a/Code/Game/GameServer/Implementation/GameServer.cpp b/Code/Game/GameServer/Implementation/GameServer.cpp index 4fd6e03c..087fa7ff 100644 --- a/Code/Game/GameServer/Implementation/GameServer.cpp +++ b/Code/Game/GameServer/Implementation/GameServer.cpp @@ -61,8 +61,6 @@ void GameServerAPI::ServerStart() { timer.reset(); server.Start(); - - } void GameServerAPI::ServerStop() { @@ -113,8 +111,6 @@ void GameServerAPI::NotifyWhenClientConnect(ClientConnectedNotify func) { if(!func) clientConnectedCallback = DefaultClientConnectedNotify; else clientConnectedCallback = func; - - } void GameServerAPI::NotifyWhenClientDisconnect(ClientDisconnectedNotify func) {