PageRenderTime 5876ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/branches/1.0.2000/Source/AJRavindiran.Jolt/RuneScape/Network/Packets/PacketSizes.cs

#
C# | 295 lines | 280 code | 3 blank | 12 comment | 0 complexity | 7e0c61ea54b63a3b6c59023217957367 MD5 | raw file
Possible License(s): GPL-3.0
  1. /* ######################################## *\
  2. * ### Copyright (C) 2009 AJ Ravindiran ### *
  3. \* ######################################## */
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. namespace AJRavindiran.Jolt.RuneScape.Network.Packets
  9. {
  10. /// <summary>
  11. /// Represents a packet size module for holding all packet sizes.
  12. /// </summary>
  13. public class PacketSizes
  14. {
  15. #region Fields
  16. private sbyte[] packetSizes = new sbyte[256];
  17. #endregion Fields
  18. #region Properties
  19. /// <summary>
  20. /// Gets the packet size values.
  21. /// </summary>
  22. public sbyte[] Sizes
  23. {
  24. get { return this.packetSizes; }
  25. }
  26. #endregion Properties
  27. #region Methods
  28. /// <summary>
  29. /// Set the packet sizes. If a packet size is -3, it is unused/undocumented.
  30. /// </summary>
  31. public void SetPacketSizes()
  32. {
  33. packetSizes[0] = -3;
  34. packetSizes[1] = -3;
  35. packetSizes[2] = -3;
  36. packetSizes[3] = 8; // Item equipping.
  37. packetSizes[4] = -3;
  38. packetSizes[5] = -3;
  39. packetSizes[6] = -3;
  40. packetSizes[7] = 2; // First NPC option.
  41. packetSizes[8] = -3;
  42. packetSizes[9] = -3;
  43. packetSizes[10] = -3;
  44. packetSizes[11] = -3;
  45. packetSizes[12] = -3;
  46. packetSizes[13] = -3;
  47. packetSizes[14] = -3;
  48. packetSizes[15] = -3;
  49. packetSizes[16] = -3;
  50. packetSizes[17] = -3;
  51. packetSizes[18] = -3;
  52. packetSizes[19] = -3;
  53. packetSizes[20] = -3;
  54. packetSizes[21] = 6; // Buttons.
  55. packetSizes[22] = 4; // Sent every time updateReq is set to true.
  56. packetSizes[23] = -3;
  57. packetSizes[24] = -3;
  58. packetSizes[25] = -3;
  59. packetSizes[26] = -3;
  60. packetSizes[27] = -3;
  61. packetSizes[28] = -3;
  62. packetSizes[29] = -3;
  63. packetSizes[30] = 8; // Add friend to list.
  64. packetSizes[31] = -3;
  65. packetSizes[32] = -3;
  66. packetSizes[33] = -3;
  67. packetSizes[34] = -3;
  68. packetSizes[35] = -3;
  69. packetSizes[36] = -3;
  70. packetSizes[37] = 2; // Second player option.
  71. packetSizes[38] = 2; // Item examine.
  72. packetSizes[39] = -3;
  73. packetSizes[40] = 16; // Item on item.
  74. packetSizes[41] = -3;
  75. packetSizes[42] = -3;
  76. packetSizes[43] = 4; // Entering an amount.
  77. packetSizes[44] = -3;
  78. packetSizes[45] = -3;
  79. packetSizes[46] = -3;
  80. packetSizes[47] = 0; // Idle packet.
  81. packetSizes[48] = -3;
  82. packetSizes[49] = -1; // Main walking packet.
  83. packetSizes[50] = -3;
  84. packetSizes[51] = -3;
  85. packetSizes[52] = 2; // Second NPC option.
  86. packetSizes[53] = -3;
  87. packetSizes[54] = -3;
  88. packetSizes[55] = -3;
  89. packetSizes[56] = -3;
  90. packetSizes[57] = -3;
  91. packetSizes[58] = -3;
  92. packetSizes[59] = 6; // Sent every time you click your mouse.
  93. packetSizes[60] = 0; // New map region has been entered.
  94. packetSizes[61] = -3;
  95. packetSizes[62] = -3;
  96. packetSizes[63] = 6; // Dialogue interfaces.
  97. packetSizes[64] = -3;
  98. packetSizes[65] = -3;
  99. packetSizes[66] = -3;
  100. packetSizes[67] = -3;
  101. packetSizes[68] = -3;
  102. packetSizes[69] = -3;
  103. packetSizes[70] = 8; // Magic on players.
  104. packetSizes[71] = -3;
  105. packetSizes[72] = -3;
  106. packetSizes[73] = -3;
  107. packetSizes[74] = -3;
  108. packetSizes[75] = -3;
  109. packetSizes[76] = -3;
  110. packetSizes[77] = -3;
  111. packetSizes[78] = -3;
  112. packetSizes[79] = -3;
  113. packetSizes[80] = -3;
  114. packetSizes[81] = -3;
  115. packetSizes[82] = -3;
  116. packetSizes[83] = -3;
  117. packetSizes[84] = 2; // Object examining.
  118. packetSizes[85] = -3;
  119. packetSizes[86] = -3;
  120. packetSizes[87] = -3;
  121. packetSizes[88] = 2; // NPC examining.
  122. packetSizes[89] = -3;
  123. packetSizes[90] = -3;
  124. packetSizes[91] = 6; // Buttons.
  125. packetSizes[92] = -3;
  126. packetSizes[93] = -3;
  127. packetSizes[94] = -3;
  128. packetSizes[95] = -3;
  129. packetSizes[96] = -3;
  130. packetSizes[97] = -3;
  131. packetSizes[98] = -3;
  132. packetSizes[99] = 4; // Unknown.
  133. packetSizes[100] = -3;
  134. packetSizes[101] = -3;
  135. packetSizes[102] = -3;
  136. packetSizes[103] = -3;
  137. packetSizes[104] = -3;
  138. packetSizes[105] = -3;
  139. packetSizes[106] = -3;
  140. packetSizes[107] = -1; // Command packet.
  141. packetSizes[108] = 0; // Interface closing.
  142. packetSizes[109] = -3;
  143. packetSizes[110] = -3;
  144. packetSizes[111] = -3;
  145. packetSizes[112] = -3;
  146. packetSizes[113] = 4; // Interface buttons.
  147. packetSizes[114] = -3;
  148. packetSizes[115] = 0; // Ping packet, sends no bytes.
  149. packetSizes[116] = -3;
  150. packetSizes[117] = -1; // Sends a good few unknown bytes.
  151. packetSizes[118] = -3;
  152. packetSizes[119] = -1; // Minimap walking.
  153. packetSizes[120] = -3;
  154. packetSizes[121] = -3;
  155. packetSizes[122] = -3;
  156. packetSizes[123] = 2; // NPC attack option.
  157. packetSizes[124] = -3;
  158. packetSizes[125] = -3;
  159. packetSizes[126] = -3;
  160. packetSizes[127] = -3;
  161. packetSizes[128] = -3;
  162. packetSizes[129] = 5; // Fixed and resizable.
  163. packetSizes[130] = -3;
  164. packetSizes[131] = 10; // Item on player.
  165. packetSizes[132] = 8; // Remove friend.
  166. packetSizes[133] = -3;
  167. packetSizes[134] = -3;
  168. packetSizes[135] = -3;
  169. packetSizes[136] = -3;
  170. packetSizes[137] = -3;
  171. packetSizes[138] = -1; // Other walk clicking, such as items on ground.
  172. packetSizes[139] = -3;
  173. packetSizes[140] = -3;
  174. packetSizes[141] = -3;
  175. packetSizes[142] = -3;
  176. packetSizes[143] = -3;
  177. packetSizes[144] = -3;
  178. packetSizes[145] = -3;
  179. packetSizes[146] = -3;
  180. packetSizes[147] = -3;
  181. packetSizes[148] = -3;
  182. packetSizes[149] = -3;
  183. packetSizes[150] = -3;
  184. packetSizes[151] = -3;
  185. packetSizes[152] = 8; // Item option 2.
  186. packetSizes[153] = -3;
  187. packetSizes[154] = 14; // Magic on item.
  188. packetSizes[155] = -3;
  189. packetSizes[156] = -3;
  190. packetSizes[157] = -3;
  191. packetSizes[158] = 6; // First object option.
  192. packetSizes[159] = -3;
  193. packetSizes[160] = 2; // First player option.
  194. packetSizes[161] = -3;
  195. packetSizes[162] = -3;
  196. packetSizes[163] = -3;
  197. packetSizes[164] = -3;
  198. packetSizes[165] = 4; // Settings buttons.
  199. packetSizes[166] = -3;
  200. packetSizes[167] = 9; // Switching items around in your inventory, banking, etc.
  201. packetSizes[168] = -3;
  202. packetSizes[169] = 6; // Buttons.
  203. packetSizes[170] = -3;
  204. packetSizes[171] = -3;
  205. packetSizes[172] = 6; // Buttons.
  206. packetSizes[173] = -3;
  207. packetSizes[174] = -3;
  208. packetSizes[175] = -3;
  209. packetSizes[176] = -3;
  210. packetSizes[177] = -3;
  211. packetSizes[178] = -1; // Message friend.
  212. packetSizes[179] = 12; // Item index switching.
  213. packetSizes[180] = -3;
  214. packetSizes[181] = -3;
  215. packetSizes[182] = -3;
  216. packetSizes[183] = -3;
  217. packetSizes[184] = -3;
  218. packetSizes[185] = -3;
  219. packetSizes[186] = 8; // Item operate.
  220. packetSizes[187] = -3;
  221. packetSizes[188] = -3;
  222. packetSizes[189] = -3;
  223. packetSizes[190] = -3;
  224. packetSizes[191] = -3;
  225. packetSizes[192] = -3;
  226. packetSizes[193] = -3;
  227. packetSizes[194] = -3;
  228. packetSizes[195] = -3;
  229. packetSizes[196] = -3;
  230. packetSizes[197] = -3;
  231. packetSizes[198] = -3;
  232. packetSizes[199] = -3;
  233. packetSizes[200] = -3;
  234. packetSizes[201] = 6; // Ground item picking up.
  235. packetSizes[202] = -3;
  236. packetSizes[203] = 8; // Item options 1.
  237. packetSizes[204] = -3;
  238. packetSizes[205] = -3;
  239. packetSizes[206] = -3;
  240. packetSizes[207] = -3;
  241. packetSizes[208] = -3;
  242. packetSizes[209] = -3;
  243. packetSizes[210] = -3;
  244. packetSizes[211] = 8; // Item dropping.
  245. packetSizes[212] = -3;
  246. packetSizes[213] = -3;
  247. packetSizes[214] = 6; // Buttons.
  248. packetSizes[215] = -3;
  249. packetSizes[216] = -3;
  250. packetSizes[217] = -3;
  251. packetSizes[218] = -3;
  252. packetSizes[219] = -3;
  253. packetSizes[220] = 8; // Item eating, drinking, etc.
  254. packetSizes[221] = -3;
  255. packetSizes[222] = -1; // Public chat text.
  256. packetSizes[223] = -3;
  257. packetSizes[224] = 14; // Item on object.
  258. packetSizes[225] = -3;
  259. packetSizes[226] = -3;
  260. packetSizes[227] = 2; // Third player option.
  261. packetSizes[228] = 6; // Second object option.
  262. packetSizes[229] = -3;
  263. packetSizes[230] = -3;
  264. packetSizes[231] = -3;
  265. packetSizes[232] = 6; // Buttons.
  266. packetSizes[233] = 6; // Buttons.
  267. packetSizes[234] = -3;
  268. packetSizes[235] = -3;
  269. packetSizes[236] = -3;
  270. packetSizes[237] = -3;
  271. packetSizes[238] = -3;
  272. packetSizes[239] = -3;
  273. packetSizes[240] = -3;
  274. packetSizes[241] = -3;
  275. packetSizes[242] = -3;
  276. packetSizes[243] = -3;
  277. packetSizes[244] = -3;
  278. packetSizes[245] = -3;
  279. packetSizes[246] = -3;
  280. packetSizes[247] = 4; // Unknown.
  281. packetSizes[248] = 1; // Unknown.
  282. packetSizes[249] = -3;
  283. packetSizes[250] = -3;
  284. packetSizes[251] = -3;
  285. packetSizes[252] = -3;
  286. packetSizes[253] = 2; // Open trade screen.
  287. packetSizes[254] = -3;
  288. packetSizes[255] = -3;
  289. }
  290. #endregion Methods
  291. }
  292. }