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