Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2007, 6:23:10 PM (16 years ago)
Author:
scheusso
Message:

errorless

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/PacketManager.h

    r413 r415  
    44#include <string>
    55#include <enet/enet.h>
    6 #include "GameStateManager.h"
     6#include "PacketTypes.h"
    77
    88//enum netowk generaly used to set the type ID of a packet
    99namespace network{
    1010 
    11 enum packet_id {
    12         ACK,
    13         MOUSE,
    14         KEYBOARD,
    15         CHAT,
    16         GAMESTATE ,
    17     CLASSID
    18 };
     11 
     12
     13
    1914
    2015/*
     
    3631        ENetPacket* clid( int classid, std::string classname, int reliable = ENET_PACKET_FLAG_RELIABLE );
    3732private:
    38         //used to set the bytes in the right order
    39         struct ack {
    40                 int id;
    41                 int a;
    42         };
    43 
    44         struct mouse {
    45                 int id;
    46                 double x;
    47                 double y;
    48         };
    49 
    50         struct keyboard {
    51                 int id;
    52                 char press;
    53         };     
    5433};
    5534
     
    6645        //call this function to decode, it calls the right decoding function below
    6746        bool elaborate( ENetPacket* packet, int clientId );
    68         struct classid{
    69           int id;
    70           int length;
    71           int classid;
    72           const char *message;
    73         };
     47       
    7448private:
    75         struct ack {
    76                 int id;
    77                 int a;
    78         };
    79 
    80         struct mouse {
    81                 int id;
    82                 double x;
    83                 double y;
    84         };
    85 
    86         struct keyboard {
    87                 int id;
    88                 char press;
    89         };
    90         //only in this class, not PacketGenerator, used as pattern to put incoming
    91         //bytes inside
    92         struct chat {
    93                 int id;
    94                 const char* message;
    95         };
    9649       
    9750       
Note: See TracChangeset for help on using the changeset viewer.