src/Network/Protocol.hh
changeset 187 f41f894213ca
child 200 2dbf40661580
equal deleted inserted replaced
186:0738f2949a2b 187:f41f894213ca
       
     1 #ifndef NETWORK_PROTOCOL_HH
       
     2 #define NETWORK_PROTOCOL_HH
       
     3 
       
     4 /*
       
     5  * The network protocol is defined here :o
       
     6  */
       
     7 
       
     8 enum NetworkChannel {
       
     9     /*
       
    10      * Core channel used for NetworkSession
       
    11      */
       
    12     NETCHAN_CORE            = 0x01,
       
    13 };
       
    14 
       
    15 enum NetworkPhysicsFlags {
       
    16     NETWORK_PHYSICS_INAIR      = 0x01,
       
    17 };
       
    18 
       
    19 enum NetworkMessage {
       
    20     NETMSG_PACKET_INVALID   = 0x00,
       
    21 
       
    22     /*
       
    23      * You have joined the game:
       
    24      *
       
    25      *  Vector      initial_position
       
    26      */
       
    27     NETMSG_SERVER_HELLO = 0x0100,
       
    28 
       
    29     /*
       
    30      * New client has connected to server:
       
    31      *  
       
    32      *  Vector      initial_position
       
    33      */
       
    34     NETMSG_PLAYER_JOIN  = 0x0101,
       
    35 
       
    36     /*
       
    37      * Client has left server:
       
    38      *
       
    39      */
       
    40     NETMSG_PLAYER_QUIT  = 0x0102,
       
    41 
       
    42     /*
       
    43      * Client has moved
       
    44      *
       
    45      *  uint16_t    PlayerInput_Move
       
    46      */
       
    47     NETMSG_CLIENT_MOVE  = 0x0201,
       
    48     
       
    49     /*
       
    50      * Initial player info
       
    51      *
       
    52      *  Vector      initial_position
       
    53      */
       
    54     NETMSG_PLAYER_INFO  = 0x0300,
       
    55 
       
    56     /*
       
    57      * Player position update
       
    58      *
       
    59      * Vector   position
       
    60      * Vector   velocity
       
    61      * uint8_t  NetworkPhysicsFlags
       
    62      */
       
    63     NETMSG_PLAYER_POSITION  = 0x0301,
       
    64 };
       
    65 
       
    66 #endif