From 8a3cd796caaffdf441aa16caf2fa1c0ab9baf3f3 Mon Sep 17 00:00:00 2001 From: dean11 Date: Wed, 19 Feb 2014 12:46:05 +0100 Subject: [PATCH] GameServer - Pontus found idiot bug that dennis made --- Code/Game/GameLogic/Game.cpp | 1 + Code/Game/GameLogic/Player.cpp | 1 - Code/Game/GameProtocols/ObjectProtocols.h | 23 ++++++++++--------- .../Implementation/GameSession_Gameplay.cpp | 4 ++-- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Code/Game/GameLogic/Game.cpp b/Code/Game/GameLogic/Game.cpp index 8b77dea4..aee57be8 100644 --- a/Code/Game/GameLogic/Game.cpp +++ b/Code/Game/GameLogic/Game.cpp @@ -123,6 +123,7 @@ bool Game::NewFrame() for (unsigned int i = 0; i < this->players.Size(); i++) { + this->onMoveFnc(this->players[i]); if(this->players[i] && this->players[i]->player) this->players[i]->player->EndFrame(); } diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 80969b29..c87f7d74 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -160,7 +160,6 @@ void Player::EndFrame() this->rigidBody->SetUp(this->rigidBody->GetState().centerPos.GetNormalized()); - Object::EndFrame(); } diff --git a/Code/Game/GameProtocols/ObjectProtocols.h b/Code/Game/GameProtocols/ObjectProtocols.h index ff6aa6e5..fc02a4bd 100644 --- a/Code/Game/GameProtocols/ObjectProtocols.h +++ b/Code/Game/GameProtocols/ObjectProtocols.h @@ -561,11 +561,11 @@ namespace GameLogic this->protocol[0].type = Oyster::Network::NetAttributeType_Short; //PLAYER_ID - this->protocol[1].type = Oyster::Network::NetAttributeType_Int; + this->protocol[1].type = Oyster::Network::NetAttributeType_Bool; //TEAM_ID this->protocol[2].type = Oyster::Network::NetAttributeType_Int; //OWNER - this->protocol[3].type = Oyster::Network::NetAttributeType_Bool; + this->protocol[3].type = Oyster::Network::NetAttributeType_Int; //PLAYER-NAME this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray; //MESH-NAME @@ -585,9 +585,10 @@ namespace GameLogic } Protocol_ObjectCreatePlayer(Oyster::Network::CustomNetProtocol& p) { - this->object_ID = p[1].value.netInt; - this->teamId = this->protocol[2].value.netInt; - this->owner = this->protocol[3].value.netBool; + this->owner = p[1].value.netBool; + this->object_ID = p[2].value.netInt; + this->teamId = p[3].value.netInt; + this->name.assign(p[4].value.netCharPtr); this->meshName.assign(p[5].value.netCharPtr); @@ -610,11 +611,11 @@ namespace GameLogic this->protocol[0].type = Oyster::Network::NetAttributeType_Short; //PLAYER_ID - this->protocol[1].type = Oyster::Network::NetAttributeType_Int; + this->protocol[1].type = Oyster::Network::NetAttributeType_Bool; //TEAM_ID this->protocol[2].type = Oyster::Network::NetAttributeType_Int; //OWNER - this->protocol[3].type = Oyster::Network::NetAttributeType_Bool; + this->protocol[3].type = Oyster::Network::NetAttributeType_Int; //PLAYER-NAME this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray; //MESH-NAME @@ -644,10 +645,10 @@ namespace GameLogic } Oyster::Network::CustomNetProtocol GetProtocol() override { - - this->protocol[1].value = this->object_ID; - this->protocol[2].value = this->teamId; - this->protocol[3].value = this->owner; + this->protocol[1].value = this->owner; + this->protocol[2].value = this->object_ID; + this->protocol[3].value = this->teamId; + this->protocol.Set(4, this->name); this->protocol.Set(5, this->meshName); diff --git a/Code/Game/GameServer/Implementation/GameSession_Gameplay.cpp b/Code/Game/GameServer/Implementation/GameSession_Gameplay.cpp index 6a9c09c2..4044cfdb 100644 --- a/Code/Game/GameServer/Implementation/GameSession_Gameplay.cpp +++ b/Code/Game/GameServer/Implementation/GameSession_Gameplay.cpp @@ -66,10 +66,10 @@ using namespace DanBias; break; case NetworkClient::ClientEventArgs::EventType_ProtocolFailedToSend: printf("\t(%i : %s) - EventType_ProtocolFailedToSend\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str()); - this->Detach(e.sender); + //this->Detach(e.sender); break; case NetworkClient::ClientEventArgs::EventType_ProtocolRecieved: - printf("\t(%i : %s) - EventType_ProtocolRecieved\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str()); + //printf("\t(%i : %s) - EventType_ProtocolRecieved\n", cl->GetClient()->GetID(), e.sender->GetIpAddress().c_str()); this->ParseProtocol(e.args.data.protocol, cl); break; }