| 1 | /* |
| 2 | * Copyright (C) 1998,1999 Ross Combs ([email protected]) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | #ifndef INCLUDED_FILE_PROTOCOL_TYPES |
| 19 | #define INCLUDED_FILE_PROTOCOL_TYPES |
| 20 | |
| 21 | #ifdef JUST_NEED_TYPES |
| 22 | # include "common/bn_type.h" |
| 23 | #else |
| 24 | # define JUST_NEED_TYPES |
| 25 | # include "common/bn_type.h" |
| 26 | # undef JUST_NEED_TYPES |
| 27 | #endif |
| 28 | |
| 29 | namespace pvpgn |
| 30 | { |
| 31 | |
| 32 | /******************************************************/ |
| 33 | typedef struct |
| 34 | { |
| 35 | bn_short size; |
| 36 | bn_short type; |
| 37 | } PACKED_ATTR() t_file_header; |
| 38 | /******************************************************/ |
| 39 | |
| 40 | |
| 41 | /******************************************************/ |
| 42 | typedef struct |
| 43 | { |
| 44 | t_file_header h; |
| 45 | } PACKED_ATTR() t_file_generic; |
| 46 | /******************************************************/ |
| 47 | |
| 48 | |
| 49 | /******************************************************/ |
| 50 | /* |
| 51 | CLIENT FILE MPQ REQ |
| 52 | 2D 00 00 01 36 38 58 49 -...68XI |
| 53 | 50 58 45 53 00 00 00 00 00 00 00 00 00 00 00 00 PXES............ |
| 54 | 00 2C 58 E1 09 28 BC 01 49 58 38 36 76 65 72 31 .,X..(..IX86ver1 |
| 55 | 2E 6D 70 71 00 .mpq. |
| 56 | |
| 57 | CLIENT FILE TOS REQ |
| 58 | 28 00 00 01 36 38 58 49 (...68XI |
| 59 | 50 58 45 53 00 00 00 00 00 00 00 00 00 00 00 00 PXES............ |
| 60 | 30 C3 89 86 09 4F BD 01 74 6F 73 2E 74 78 74 00 0....O..tos.txt. |
| 61 | |
| 62 | CLIENT FILE AD REQ |
| 63 | 2D 00 00 01 36 38 58 49 -...68XI |
| 64 | 50 58 45 53 2B 51 02 00 2E 70 63 78 00 00 00 00 PXES+Q...pcx.... |
| 65 | 00 00 00 00 58 01 B2 00 61 64 30 32 35 31 32 62 ....X...ad02512b |
| 66 | 2E 70 63 78 00 .pcx. |
| 67 | */ |
| 68 | #define CLIENT_FILE_REQ 0x0100 |
| 69 | typedef struct |
| 70 | { |
| 71 | t_file_header h; |
| 72 | bn_int archtag; |
| 73 | bn_int clienttag; |
| 74 | bn_int adid; |
| 75 | bn_int extensiontag; /* unlike other tags, this one is "forward" */ |
| 76 | bn_int startoffset; /* is this actually used in the original clients? */ |
| 77 | bn_long timestamp; |
| 78 | /* filename */ |
| 79 | } PACKED_ATTR() t_client_file_req; |
| 80 | /******************************************************/ |
| 81 | |
| 82 | /* |
| 83 | the next 2 file requests appeared on w3 first. first it sends filereq2 then |
| 84 | server replies with some rnadom int then client sends filereq3 (which is a |
| 85 | raw packet with no valuable header) then filename then server replies with |
| 86 | normal file_reply and sends the contents |
| 87 | |
| 88 | 12: recv class=file[0x03] type=unknown[0x0200] length=20 |
| 89 | 0000: 14 00 00 02 36 38 58 49 33 52 41 57 00 00 00 00 ....68XI3RAW.... |
| 90 | 0010: 00 00 00 00 .... |
| 91 | */ |
| 92 | #define CLIENT_FILE_REQ2 0x0200 |
| 93 | typedef struct |
| 94 | { |
| 95 | t_file_header h; |
| 96 | bn_int archtag; |
| 97 | bn_int clienttag; |
| 98 | bn_long unknown1; |
| 99 | } PACKED_ATTR() t_client_file_req2; |
| 100 | |
| 101 | #define CLIENT_FILE_REQ3 0x0000 |
| 102 | typedef struct |
| 103 | { |
| 104 | bn_int unknown1; |
| 105 | bn_long timestamp; |
| 106 | bn_long unknown2; |
| 107 | bn_long unknown3; |
| 108 | bn_long unknown4; |
| 109 | bn_long unknown5; |
| 110 | bn_long unknown6; |
| 111 | /* filename */ |
| 112 | } PACKED_ATTR() t_client_file_req3; |
| 113 | |
| 114 | /******************************************************/ |
| 115 | /* SERVER FILE MPQ REPLY |
| 116 | 25 00 00 00 33 1B 00 00 %...3... |
| 117 | 00 00 00 00 00 00 00 00 00 2C 58 E1 09 28 BC 01 .........,X..(.. |
| 118 | 49 58 38 36 76 65 72 31 2E 6D 70 71 00 IX86ver1.mpq. |
| 119 | |
| 120 | SERVER FILE TOS REPLY |
| 121 | 20 00 00 00 E4 00 00 00 P."..... ....... |
| 122 | 00 00 00 00 00 00 00 00 30 C3 89 86 09 4F BD 01 ........0....O.. |
| 123 | 74 6F 73 2E 74 78 74 00 tos.txt. |
| 124 | |
| 125 | SERVER FILE AD REPLY |
| 126 | 25 00 00 00 30 2E 00 00 %...0... |
| 127 | 2B 51 02 00 2E 70 63 78 00 00 00 00 58 01 B2 00 +Q...pcx....X... |
| 128 | 61 64 30 32 35 31 32 62 2E 70 63 78 00 ad02512b.pcx. |
| 129 | */ |
| 130 | #define SERVER_FILE_REPLY 0x0000 |
| 131 | typedef struct |
| 132 | { |
| 133 | t_file_header h; |
| 134 | bn_int filelen; |
| 135 | bn_int adid; |
| 136 | bn_int extensiontag; /* unlike other tags, this one is "forward" */ |
| 137 | bn_long timestamp; |
| 138 | /* filename */ |
| 139 | } PACKED_ATTR() t_server_file_reply; |
| 140 | /******************************************************/ |
| 141 | |
| 142 | #define SERVER_FILE_UNKNOWN1 0xdeadbeef |
| 143 | typedef struct |
| 144 | { |
| 145 | bn_int unknown; |
| 146 | } PACKED_ATTR() t_server_file_unknown1; |
| 147 | |
| 148 | } |
| 149 | |
| 150 | #endif |