Changeset b35b2b2 in network-game for common/MessageContainer.h


Ignore:
Timestamp:
Jul 29, 2013, 10:32:59 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
d05086b
Parents:
297682c
Message:

Added a basic ingame debug console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/MessageContainer.h

    r297682c rb35b2b2  
    33
    44#include "Compiler.h"
     5
     6#include <string>
    57
    68#if defined WINDOWS
     
    1012   #include <netinet/in.h>
    1113#endif
     14
     15using namespace std;
    1216
    1317#define MSG_TYPE_ACK               1
     
    5458   void setAcked(bool acked);
    5559   void setTimeAcked(unsigned long long time);
     60
     61   static string getMsgTypeString(int msgType) {
     62      switch(msgType) {
     63         case MSG_TYPE_ACK: return "MSG_TYPE_ACK";
     64         case MSG_TYPE_REGISTER: return "MSG_TYPE_REGISTER";
     65         case MSG_TYPE_LOGIN: return "MSG_TYPE_LOGIN";
     66         case MSG_TYPE_LOGOUT: return "MSG_TYPE_LOGOUT";
     67         case MSG_TYPE_CHAT: return "MSG_TYPE_CHAT";
     68         case MSG_TYPE_PLAYER: return "MSG_TYPE_PLAYER";
     69         case MSG_TYPE_PLAYER_MOVE: return "MSG_TYPE_PLAYER_MOVE";
     70         case MSG_TYPE_OBJECT: return "MSG_TYPE_OBJECT";
     71         case MSG_TYPE_REMOVE_OBJECT: return "MSG_TYPE_REMOVE_OBJECT";
     72         case MSG_TYPE_PICKUP_FLAG: return "MSG_TYPE_PICKUP_FLAG";
     73         case MSG_TYPE_DROP_FLAG: return "MSG_TYPE_DROP_FLAG";
     74         case MSG_TYPE_SCORE: return "MSG_TYPE_SCORE";
     75         case MSG_TYPE_START_ATTACK: return "MSG_TYPE_START_ATACK";
     76         case MSG_TYPE_ATTACK: return "MSG_TYPE_ATTACK";
     77         case MSG_TYPE_PROJECTILE: return "MSG_TYPE_PROJECTILE";
     78         case MSG_TYPE_REMOVE_PROJECTILE: return "MSG_TYPE_REMOVE_PROJECTILE";
     79         default: return "Unknown";
     80      }
     81   }
    5682};
    5783
Note: See TracChangeset for help on using the changeset viewer.