-typedef enum _MyEventType { E_none, E_alarm, E_key, E_net,
- E_lostConn, E_robot, E_lostRobot } MyEventType;
-typedef enum _NetPacketType { NP_endConn, NP_giveJunk, NP_newPiece,
- NP_down, NP_left, NP_right,
- NP_rotright, NP_rotleft, NP_drop, NP_clear,
- NP_insertJunk, NP_startConn,
- NP_userName, NP_pause, NP_version,
- NP_byeBye } NetPacketType;
-
-typedef signed char BlockType;
-
+typedef enum _MyEventType {
+ E_none, E_alarm, E_key, E_connect, E_net, E_lostConn
+} MyEventType;
+typedef enum _NetPacketType {
+ NP_endConn, //client/server quits
+ NP_byeBye, //unused atm
+ NP_error, //handshake error
+ NP_hello, //check versions
+ NP_gamedata, //game options
+
+ NP_start, //game ok to start
+ NP_pause, //player (un)pauses
+ NP_stop, //game ended
+ NP_newPlayer, //add new player
+ NP_team, //player switched teams
+ NP_argghhh, //player died
+ NP_part, //player left
+
+ NP_msg, //chat message
+
+ NP_newPiece, //new piece info
+ NP_rotright, //rotate piece clockwise
+ NP_rotleft, //rotate piece counterclockwise
+ NP_left, //move piece left
+ NP_right, //move piece right
+ NP_down, //move piece one down
+ NP_drop, //drop piece to bottom
+ NP_clear, //line cleared
+ NP_insertJunk, //player added junk
+
+ NP_giveJunk //player has to add junk
+} NetPacketType;
+
+typedef struct {
+ short sender, uid;
+ NetPacketType type;
+ int size;
+ void *data;
+} _netEvent;