| 1 |
//to client |
| 2 |
#include "Mariusnet_Public.h" |
| 3 |
enum |
| 4 |
{ |
| 5 |
pt_RoomList = 0x0000, |
| 6 |
pt_PlayerList = 0x0001, |
| 7 |
pt_GameList = 0x0002, |
| 8 |
pt_UserLoggedIn = 0x7,//0x0003, |
| 9 |
pt_EncryptionKey = 0x0006, |
| 10 |
pt_LoginInfo = 0x3,//0x0007, |
| 11 |
pt_PlayerInfo = 0x0008, |
| 12 |
pt_PlayerId = 0x0009, |
| 13 |
pt_BlueBarMsg = 0x000A, |
| 14 |
pt_PasswordAck = 0x000C, |
| 15 |
pt_FindResponse = 0x000E, |
| 16 |
pt_BuddyList = 0x000F, // the actual buddy list - i.e. names and such |
| 17 |
pt_OrderList = 0x0010, |
| 18 |
pt_PlayerInfoResponse = 0x0011, |
| 19 |
pt_UpdatePlayerStats = 0x0012, |
| 20 |
pt_UpdateBuddyList = 0x0013, // buddy status - i.e. online/offline |
| 21 |
pt_UpdateOrderList = 0x0014, |
| 22 |
}; |
| 23 |
|
| 24 |
//from client |
| 25 |
enum |
| 26 |
{ |
| 27 |
pt_PlayerLogin = 0x0064, |
| 28 |
pt_ChatRoomLogin = 0x0065, |
| 29 |
pt_RoomPlayerInfo = 0x0067, |
| 30 |
pt_GameInfo = 0x0068, |
| 31 |
pt_RemoveGame = 0x0069, |
| 32 |
pt_SetPlayerState = 0x006B, |
| 33 |
pt_Password = 0x006D, |
| 34 |
pt_RequestRefresh = 0x006E, |
| 35 |
pt_GamePlayerList = 0x006F, // game start player list |
| 36 |
pt_PlayerScores = 0x0070, // game over player scores |
| 37 |
pt_ResetScoring = 0x0071, // reset metaserver game scoring |
| 38 |
pt_StartGame = 0x0072, |
| 39 |
pt_Localization = 0x0073, |
| 40 |
pt_GameSearchQuery = 0x0074, |
| 41 |
pt_FindPlayer = 0x0075, |
| 42 |
pt_BuddyListQuery = 0x0076, // request a buddy list update |
| 43 |
pt_OrderListQuery = 0x0077, |
| 44 |
pt_UpdateBuddy = 0x0078, // add/remove buddy |
| 45 |
pt_PlayerInfoQuery = 0x0079, |
| 46 |
pt_SetPlayerStats = 0x007A, // change player stats (city/state/profile) |
| 47 |
pt_ChatMessage = 0x00C8, |
| 48 |
pt_WhisperMessage = 0x00C9, |
| 49 |
pt_KeepAlive = 0x00CA, |
| 50 |
pt_SessionKey = 0x00CB, |
| 51 |
}; |
| 52 |
|
| 53 |
enum |
| 54 |
{ |
| 55 |
ctMyth1 = 0, |
| 56 |
ctMyth2 = 1, |
| 57 |
// ctMyth3 = 2; |
| 58 |
ctMarathon = 3, |
| 59 |
ctMyth1Unified = 4, |
| 60 |
ctMyth2Unified = 5, |
| 61 |
ctMyth3Unified = 6, |
| 62 |
}; |
| 63 |
|
| 64 |
|
| 65 |
typedef struct |
| 66 |
{ |
| 67 |
short PacketSignature;// = 0xDEAD; |
| 68 |
short PacketId; |
| 69 |
unsigned int PacketSize; |
| 70 |
} marius_header; |
| 71 |
|
| 72 |
typedef struct |
| 73 |
{ |
| 74 |
short Red; |
| 75 |
short Green; |
| 76 |
short Blue; |
| 77 |
short Flags; |
| 78 |
} m_colour; |
| 79 |
|
| 80 |
typedef struct |
| 81 |
{ |
| 82 |
char Icon; |
| 83 |
char pad; |
| 84 |
short Flags; // 0=active, 1=inactive, in a game, grayed out, can't see chat |
| 85 |
m_colour Colors[2]; |
| 86 |
short orderIndex; |
| 87 |
short clientVersion; |
| 88 |
char stupid_14byte_pad[14]; |
| 89 |
char Name[112]; // 2 #0 terminated fields - Name, Team Name |
| 90 |
} m_player_info; |
| 91 |
|
| 92 |
typedef struct |
| 93 |
{ |
| 94 |
short Platform; //Windows - 1 |
| 95 |
short MetaVersion; //0 |
| 96 |
char pad[3]; |
| 97 |
char UpdateAppearance; // save player settings on server, change to bits, bit 0=update, bit 1=demo |
| 98 |
int PlayerId; //0 |
| 99 |
short EncryptionType; //0 - kCRYPT_PLAINTEXT, screw encryption for now |
| 100 |
short PlayerInfoSize; //40 + strlen(playername) + strlen(plaerteam( |
| 101 |
char AppName[32]; //MARATHON...later ONI ;) |
| 102 |
char BuildDate[32]; //_DATE_ |
| 103 |
char BuildTime[32]; //_TIME_ |
| 104 |
char LoginId[32]; //username |
| 105 |
m_player_info PlayerInfo; |
| 106 |
} m_player_login; |
| 107 |
|
| 108 |
typedef struct |
| 109 |
{ |
| 110 |
short EncryptionType; |
| 111 |
unsigned char salt[16]; |
| 112 |
} m_salt; |
| 113 |
|
| 114 |
typedef struct |
| 115 |
{ |
| 116 |
int one; |
| 117 |
int two; |
| 118 |
int three; |
| 119 |
int zero; |
| 120 |
} m_localization; |
| 121 |
|
| 122 |
typedef struct |
| 123 |
{ |
| 124 |
unsigned char passHash[16]; |
| 125 |
} m_password; |
| 126 |
|
| 127 |
typedef struct |
| 128 |
{ |
| 129 |
int userID; |
| 130 |
short order; |
| 131 |
short unused; |
| 132 |
char Token[32]; |
| 133 |
|
| 134 |
} m_login_success; |
| 135 |
|
| 136 |
typedef struct |
| 137 |
{ |
| 138 |
int code; |
| 139 |
char DenialMessage[]; |
| 140 |
} m_login_denied; |
| 141 |
|
| 142 |
typedef struct |
| 143 |
{ |
| 144 |
short RoomIndex; |
| 145 |
short PlayerCount; |
| 146 |
int IPAddress; |
| 147 |
short Port; |
| 148 |
short GameCount; |
| 149 |
int pad[3]; |
| 150 |
} m_room; |
| 151 |
|
| 152 |
typedef struct |
| 153 |
{ |
| 154 |
m_room Rooms[64]; |
| 155 |
} m_roomlist; |
| 156 |
|
| 157 |
typedef struct |
| 158 |
{ |
| 159 |
char RoomKey[32]; |
| 160 |
char Name[32]; |
| 161 |
} m_chatroom_join; |
| 162 |
|
| 163 |
typedef struct |
| 164 |
{ |
| 165 |
char Message[512]; |
| 166 |
} m_motd; |
| 167 |
|
| 168 |
typedef struct |
| 169 |
{ |
| 170 |
m_colour PrimaryColor; |
| 171 |
m_colour SecondaryColor; |
| 172 |
int SenderId; |
| 173 |
int TargetId; |
| 174 |
char Message[256]; |
| 175 |
} m_message; |
| 176 |
|
| 177 |
typedef struct |
| 178 |
{ |
| 179 |
unsigned int gameID; |
| 180 |
unsigned int ipAddress; |
| 181 |
unsigned short port; |
| 182 |
unsigned char verb; |
| 183 |
unsigned char gameEnable; |
| 184 |
unsigned int timeRemaining; |
| 185 |
unsigned int hostPlayerID; |
| 186 |
unsigned short len; |
| 187 |
int unused1; |
| 188 |
int unused2; |
| 189 |
short pad; |
| 190 |
m_gamedescription g; |
| 191 |
} m_gameinfo; |
| 192 |
|
| 193 |
typedef struct |
| 194 |
{ |
| 195 |
m_gameinfo Games[]; |
| 196 |
} m_gamelist; |
| 197 |
typedef struct |
| 198 |
{ |
| 199 |
marius_header header; |
| 200 |
union |
| 201 |
{ |
| 202 |
m_player_login login; |
| 203 |
m_password password; |
| 204 |
m_localization localization; |
| 205 |
m_salt salt; |
| 206 |
m_login_success login_success; |
| 207 |
m_login_denied login_denied; |
| 208 |
m_roomlist roomlist; |
| 209 |
m_chatroom_join chatroom_join; |
| 210 |
m_player_info player_info; |
| 211 |
m_motd motd; |
| 212 |
m_message message; |
| 213 |
m_announcegame newgame; |
| 214 |
m_gamelist gamelist; |
| 215 |
}; |
| 216 |
} marius_packet; |