Changeset 415 for code/branches/FICN/src/network/PacketManager.h
- Timestamp:
- Dec 5, 2007, 6:23:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/PacketManager.h
r413 r415 4 4 #include <string> 5 5 #include <enet/enet.h> 6 #include " GameStateManager.h"6 #include "PacketTypes.h" 7 7 8 8 //enum netowk generaly used to set the type ID of a packet 9 9 namespace network{ 10 10 11 enum packet_id { 12 ACK, 13 MOUSE, 14 KEYBOARD, 15 CHAT, 16 GAMESTATE , 17 CLASSID 18 }; 11 12 13 19 14 20 15 /* … … 36 31 ENetPacket* clid( int classid, std::string classname, int reliable = ENET_PACKET_FLAG_RELIABLE ); 37 32 private: 38 //used to set the bytes in the right order39 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 };54 33 }; 55 34 … … 66 45 //call this function to decode, it calls the right decoding function below 67 46 bool elaborate( ENetPacket* packet, int clientId ); 68 struct classid{ 69 int id; 70 int length; 71 int classid; 72 const char *message; 73 }; 47 74 48 private: 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 incoming91 //bytes inside92 struct chat {93 int id;94 const char* message;95 };96 49 97 50
Note: See TracChangeset
for help on using the changeset viewer.