Danbias/Code/Game/GameProtocols/ProtocolIdentificationID.h

76 lines
2.6 KiB
C
Raw Normal View History

2013-12-16 09:00:11 +01:00
/////////////////////////////////////////////////////////////////////
// Created 2013 by:
// [Dennis Andersen], [Linda Andersson]
/////////////////////////////////////////////////////////////////////
2013-12-09 11:57:34 +01:00
#ifndef GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H
#define GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H
/* THERE CAN ABSOLUTLEY NOT BE TWO DEFINITIONS WITH THE SAME ID!! */
2013-12-18 12:18:01 +01:00
2013-12-20 09:42:02 +01:00
/** Index where the identifier is located(aka protocol identification index) **/
#define protocol_INDEX_ID 0
2013-12-19 10:21:03 +01:00
2013-12-09 11:57:34 +01:00
2013-12-19 12:32:23 +01:00
/***********************************/
/********* RESERVERD PROTOCOLS *****/
2013-12-20 09:42:02 +01:00
/********** [ 0 - 100 ] *********/
2013-12-16 09:00:11 +01:00
2013-12-19 12:32:23 +01:00
/***********************************/
/********* GENERAL PROTOCOLS *******/
2013-12-20 09:42:02 +01:00
/***********[ 100 - 200 ]***********/
#define protocol_GeneralMIN 100 /* This defines lower bounds of general protocols (okay to have same value as the first since this should not realy be sent). */
2013-12-19 12:32:23 +01:00
#define protocol_General_Disconnect 100
2013-12-20 09:42:02 +01:00
#define protocol_General_Ping 102
#define protocol_General_Text 103
#define protocol_General_Status 104
#define protocol_General_DisconnectKick 105
#define protocol_GeneralMAX 199
2013-12-19 12:32:23 +01:00
/***********************************/
/********* LOBBY PROTOCOLS *********/
2013-12-20 09:42:02 +01:00
/***********[ 200 - 300 ]***********/
#define protocol_LobbyMIN 200
2013-12-19 12:32:23 +01:00
#define protocol_Lobby_CreateGame 200
#define protocol_Lobby_JoinGame 201
#define protocol_Lobby_StartGame 202
#define protocol_Lobby_JoinLobby 203
#define protocol_Lobby_LeaveLobby 204
#define protocol_Lobby_CreateGameLobby 205
2013-12-20 09:42:02 +01:00
#define protocol_LobbyMAX 299
2013-12-19 12:32:23 +01:00
/***********************************/
/********* GAMEPLAY PROTOCOLS ******/
/***********[ 300 - 400 ]***********/
2013-12-20 09:42:02 +01:00
#define protocol_GameplayMIN 300
#define protocol_Gameplay_PlayerNavigation 300
#define protocol_Gameplay_PlayerMouseMovement 301
#define protocol_Gameplay_PlayerPosition 302
#define protocol_Gameplay_CreateObject 303
#define protocol_Gameplay_RemoveObject 304
#define protocol_Gameplay_ObjectPosition 305
#define protocol_GameplayMAX 399
/************************************/
/*********** PROTOCOL MACROS ********/
/************************************/
inline bool ProtocolIsLobby(short ID) { return (ID >= protocol_LobbyMIN && ID <= protocol_LobbyMAX); }
inline bool ProtocolIsGeneral(short ID) { return (ID >= protocol_GeneralMIN && ID <= protocol_GeneralMAX); }
inline bool ProtocolIsGameplay(short ID) { return (ID >= protocol_GameplayMIN && ID <= protocol_GameplayMAX); }
2013-12-19 12:32:23 +01:00
/***********************************/
/*********** TEST PROTOCOLS ********/
/***********[ 1000 - x ]************/
2013-12-16 09:50:23 +01:00
#define PROTOCOL_TEST 1000
2013-12-12 10:36:55 +01:00
2013-12-20 09:42:02 +01:00
2013-12-09 11:57:34 +01:00
#endif // !GAMEPROTOCOL_PROTOCOL_DEFINITION_ID_H