terom@5: #ifndef NETWORK_HH terom@5: #define NETWORK_HH terom@5: terom@21: #include "NetworkConfig.hh" terom@21: #include "GameState.hh" terom@21: terom@13: #include terom@5: terom@35: const int32_t COORDINATE_MAX = 1 << 30; terom@35: terom@21: class NetworkCore { terom@24: protected: terom@24: GameState &state; terom@5: terom@24: CL_SlotContainer slots; terom@22: terom@24: // constructor terom@32: NetworkCore (GameState &state) : state(state) { } terom@35: terom@35: terom@22: }; terom@22: terom@36: enum NetworkChannel { terom@36: /* terom@36: * Core channel used for NetworkSession terom@36: */ terom@36: NETCHAN_CORE = 0x01, terom@36: }; terom@35: terom@22: enum NetworkMessage { terom@24: NETMSG_PACKET_INVALID = 0x00, terom@22: terom@24: /* terom@24: * You have joined the game: terom@24: * terom@35: * Vector initial_position terom@24: */ terom@24: NETMSG_SERVER_HELLO = 0x0100, terom@22: terom@24: /* terom@24: * New client has connected to server: terom@35: * terom@35: * Vector initial_position terom@24: */ terom@24: NETMSG_PLAYER_JOIN = 0x0101, terom@22: terom@24: /* terom@24: * Client has left server: terom@24: * terom@24: */ terom@24: NETMSG_PLAYER_QUIT = 0x0102, terom@24: terom@24: /* terom@24: * Client has moved terom@24: * terom@35: * Vector impulse_force terom@35: * uint16_t impulse_ms terom@24: */ terom@24: NETMSG_CLIENT_MOVE = 0x0201, terom@24: terom@24: /* terom@24: * Initial player info terom@24: * terom@35: * Vector initial_position terom@24: */ terom@24: NETMSG_PLAYER_INFO = 0x0300, terom@24: terom@24: /* terom@24: * Player position update terom@24: * terom@35: * Vector position terom@35: * Vector velocity terom@24: */ terom@24: NETMSG_PLAYER_POSITION = 0x0301, terom@5: }; terom@5: terom@5: #endif