diff --git a/Code/Game/GameProtocols/ObjectProtocols.h b/Code/Game/GameProtocols/ObjectProtocols.h index 47c2dddc..234a5301 100644 --- a/Code/Game/GameProtocols/ObjectProtocols.h +++ b/Code/Game/GameProtocols/ObjectProtocols.h @@ -937,5 +937,45 @@ namespace GameLogic Oyster::Network::CustomNetProtocol protocol; }; } +//#define protocol_Gameplay_ObjectAction 368 + struct Protocol_ObjectAction :public Oyster::Network::CustomProtocolObject + { + short objectID; + float animationID; + + Protocol_ObjectAction() + { + this->protocol[0].value = protocol_Gameplay_ObjectAction; + this->protocol[0].type = Oyster::Network::NetAttributeType_Short; + this->protocol[1].type = Oyster::Network::NetAttributeType_Short; + this->protocol[2].type = Oyster::Network::NetAttributeType_Float; + + objectID = 0; + animationID = -1; + } + Protocol_ObjectAction(Oyster::Network::CustomNetProtocol& p) + { + objectID = p[1].value.netShort; + animationID = p[2].value.netFloat; + } + Protocol_ObjectAction(float animID, int id) + { + this->protocol[0].value = protocol_Gameplay_ObjectAction; + this->protocol[0].type = Oyster::Network::NetAttributeType_Short; + this->protocol[1].type = Oyster::Network::NetAttributeType_Short; + this->protocol[2].type = Oyster::Network::NetAttributeType_Float; + objectID = id; + animationID = animID; + } + Oyster::Network::CustomNetProtocol GetProtocol() override + { + this->protocol[1].value = objectID; + this->protocol[2].value = animationID; + return protocol; + } + + private: + Oyster::Network::CustomNetProtocol protocol; + }; #endif // !GAMELOGIC_PLAYER_PROTOCOLS_H \ No newline at end of file diff --git a/Code/Game/GameProtocols/ProtocolIdentificationID.h b/Code/Game/GameProtocols/ProtocolIdentificationID.h index 79235e2f..7aaf2eee 100644 --- a/Code/Game/GameProtocols/ProtocolIdentificationID.h +++ b/Code/Game/GameProtocols/ProtocolIdentificationID.h @@ -70,6 +70,7 @@ #define protocol_Gameplay_ObjectRespawn 365 #define protocol_Gameplay_ObjectDie 366 #define protocol_Gameplay_ObjectDisconnectPlayer 367 +#define protocol_Gameplay_ObjectAction 368 #define protocol_GameplayMAX 399