KProtocol.cpp
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:15k
源码类别:

模拟服务器

开发平台:

C/C++

  1. #include "KCore.h"
  2. #include "KEngine.h"
  3. #include "KProtocol.h"
  4. #include "KPlayer.h"
  5. #include "KItemList.h"
  6. #include "KLadder.h"
  7. int g_nProtocolSize[MAX_PROTOCOL_NUM] = 
  8. {
  9. #ifndef _SERVER // 客户端接收到的服务器到客户端的协议长度
  10. -1, // s2c_login,
  11. -1, // s2c_logout,
  12. sizeof(BYTE), // s2c_syncend,
  13. sizeof(CURPLAYER_SYNC), // s2c_synccurplayer,
  14. -1, // s2c_synccurplayerskill
  15. sizeof(CURPLAYER_NORMAL_SYNC),// s2c_synccurplayernormal
  16. -1, // s2c_newplayer,
  17. -1, // s2c_removeplayer,
  18. sizeof(WORLD_SYNC), // s2c_syncworld,
  19. sizeof(PLAYER_SYNC), // s2c_syncplayer,
  20. sizeof(PLAYER_NORMAL_SYNC), // s2c_syncplayermin,
  21. -1, //sizeof(NPC_SYNC), // s2c_syncnpc,
  22. sizeof(NPC_NORMAL_SYNC), // s2c_syncnpcmin,
  23. sizeof(NPC_PLAYER_TYPE_NORMAL_SYNC), // s2c_syncnpcminplayer,
  24. -1,//sizeof(OBJ_ADD_SYNC), // s2c_objadd,
  25. sizeof(OBJ_SYNC_STATE), // s2c_syncobjstate,
  26. sizeof(OBJ_SYNC_DIR), // s2c_syncobjdir,
  27. sizeof(OBJ_SYNC_REMOVE), // s2c_objremove,
  28. sizeof(OBJ_SYNC_TRAP_ACT), // s2c_objTrapAct,
  29. sizeof(NPC_REMOVE_SYNC), // s2c_npcremove,
  30. sizeof(NPC_WALK_SYNC), // s2c_npcwalk,
  31. sizeof(NPC_RUN_SYNC), // s2c_npcrun,
  32. -1, // s2c_npcattack,
  33. -1, // s2c_npcmagic,
  34. sizeof(NPC_JUMP_SYNC), // s2c_npcjump,
  35. -1, // s2c_npctalk,
  36. sizeof(NPC_HURT_SYNC), // s2c_npchurt,
  37. sizeof(NPC_DEATH_SYNC), // s2c_npcdeath,
  38. sizeof(NPC_CHGCURCAMP_SYNC),// s2c_npcchgcurcamp,
  39. sizeof(NPC_CHGCAMP_SYNC), // s2c_npcchgcamp,
  40. sizeof(NPC_SKILL_SYNC), // s2c_skillcast,
  41. -1, // s2c_playertalk,
  42. sizeof(PLAYER_EXP_SYNC), // s2c_playerexp,
  43. sizeof(PLAYER_SEND_TEAM_INFO), // s2c_teaminfo,
  44. sizeof(PLAYER_SEND_SELF_TEAM_INFO), // s2c_teamselfinfo,
  45. sizeof(PLAYER_APPLY_TEAM_INFO_FALSE), // s2c_teamapplyinfofalse,
  46. sizeof(PLAYER_SEND_CREATE_TEAM_SUCCESS),// s2c_teamcreatesuccess,
  47. sizeof(PLAYER_SEND_CREATE_TEAM_FALSE), // s2c_teamcreatefalse,
  48. sizeof(PLAYER_TEAM_OPEN_CLOSE), // s2c_teamopenclose,
  49. sizeof(PLAYER_APPLY_ADD_TEAM), // s2c_teamgetapply,
  50. sizeof(PLAYER_TEAM_ADD_MEMBER), // s2c_teamaddmember,
  51. sizeof(PLAYER_LEAVE_TEAM), // s2c_teamleave,
  52. sizeof(PLAYER_TEAM_CHANGE_CAPTAIN), // s2c_teamchangecaptain,
  53. sizeof(PLAYER_FACTION_DATA), // s2c_playerfactiondata,
  54. sizeof(PLAYER_LEAVE_FACTION), // s2c_playerleavefaction,
  55. sizeof(PLAYER_FACTION_SKILL_LEVEL), // s2c_playerfactionskilllevel,
  56. -1,//sizeof(PLAYER_SEND_CHAT_SYNC), // s2c_playersendchat,
  57. sizeof(PLAYER_LEAD_EXP_SYNC), // s2c_playersyncleadexp
  58. sizeof(PLAYER_LEVEL_UP_SYNC), // s2c_playerlevelup
  59. sizeof(PLAYER_TEAMMATE_LEVEL_SYNC), // s2c_teammatelevel
  60. sizeof(PLAYER_ATTRIBUTE_SYNC), // s2c_playersyncattribute
  61. sizeof(PLAYER_SKILL_LEVEL_SYNC), // s2c_playerskilllevel
  62. sizeof(ITEM_SYNC), // s2c_syncitem
  63. sizeof(ITEM_REMOVE_SYNC), // s2c_removeitem
  64. sizeof(PLAYER_MONEY_SYNC), // s2c_syncmoney
  65. sizeof(PLAYER_MOVE_ITEM_SYNC), // s2c_playermoveitem
  66. -1, // s2c_playershowui
  67. sizeof(CHAT_APPLY_ADD_FRIEND_SYNC), // s2c_chatapplyaddfriend
  68. sizeof(CHAT_ADD_FRIEND_SYNC), // s2c_chataddfriend
  69. -1,//sizeof(CHAT_REFUSE_FRIEND_SYNC), // s2c_chatrefusefriend
  70. sizeof(CHAT_ADD_FRIEND_FAIL_SYNC), // s2c_chataddfriendfail
  71. sizeof(CHAT_LOGIN_FRIEND_NONAME_SYNC), // s2c_chatloginfriendnoname
  72. -1,//sizeof(CHAT_LOGIN_FRIEND_NAME_SYNC), // s2c_chatloginfriendname
  73. sizeof(CHAT_ONE_FRIEND_DATA_SYNC), // s2c_chatonefrienddata
  74. sizeof(CHAT_FRIEND_ONLINE_SYNC), // s2c_chatfriendinline
  75. sizeof(CHAT_DELETE_FRIEND_SYNC), // s2c_chatdeletefriend
  76. sizeof(CHAT_FRIEND_OFFLINE_SYNC), // s2c_chatfriendoffline
  77. sizeof(ROLE_LIST_SYNC), // s2c_syncrolelist
  78. sizeof(TRADE_CHANGE_STATE_SYNC), // s2c_tradechangestate
  79. -1, // NPC_SET_MENU_STATE_SYNC    s2c_npcsetmenustate
  80. sizeof(TRADE_MONEY_SYNC), // s2c_trademoneysync
  81. sizeof(TRADE_DECISION_SYNC), // s2c_tradedecision
  82. -1, // sizeof(CHAT_SCREENSINGLE_ERROR_SYNC)s2c_chatscreensingleerror
  83. sizeof(NPC_SYNC_STATEINFO), // s2c_syncnpcstate,
  84. -1, // sizeof(TEAM_INVITE_ADD_SYNC)    s2c_teaminviteadd
  85. sizeof(TRADE_STATE_SYNC), // s2c_tradepressoksync
  86. sizeof(PING_COMMAND), // s2c_ping
  87. sizeof(NPC_SIT_SYNC), // s2c_npcsit
  88. sizeof(SALE_BOX_SYNC), // s2c_opensalebox
  89. sizeof(NPC_SKILL_SYNC), // s2cDirectlyCastSkill
  90. -1, // s2c_msgshow
  91. -1, // s2c_syncstateeffect
  92. sizeof(BYTE), // s2c_openstorebox
  93. sizeof(NPC_REVIVE_SYNC), // s2c_playerrevive
  94. sizeof(NPC_REQUEST_FAIL), // s2c_requestnpcfail
  95. sizeof(TRADE_APPLY_START_SYNC), // s2c_tradeapplystart
  96. sizeof(tagNewDelRoleResponse), // s2c_rolenewdelresponse
  97. sizeof(ITEM_AUTO_MOVE_SYNC), // s2c_ItemAutoMove
  98. sizeof(BYTE), // s2c_itemexchangefinish
  99. sizeof(SYNC_WEATHER), // s2c_changeweather
  100. sizeof(PK_NORMAL_FLAG_SYNC), // s2c_pksyncnormalflag
  101. -1,//sizeof(PK_ENMITY_STATE_SYNC), // s2c_pksyncenmitystate
  102. -1,//sizeof(PK_EXERCISE_STATE_SYNC), // s2c_pksyncexercisestate
  103. sizeof(PK_VALUE_SYNC), // s2c_pksyncpkvalue
  104. sizeof(NPC_SLEEP_SYNC), // s2c_npcsleepmode
  105. sizeof(VIEW_EQUIP_SYNC), // s2c_viewequip
  106. sizeof(LADDER_DATA), // s2c_ladderresult
  107. -1, // s2c_ladderlist
  108. sizeof(TONG_CREATE_SYNC), // s2c_tongcreate
  109. sizeof(PING_COMMAND), // s2c_replyclientping
  110. sizeof(NPC_GOLD_CHANGE_SYNC), // s2c_npcgoldchange
  111. sizeof(ITEM_DURABILITY_CHANGE), // s2c_itemdurabilitychange
  112. #else
  113. sizeof(LOGIN_COMMAND), // c2s_login,
  114. sizeof(tagLogicLogin), // c2s_logicLogin,
  115. sizeof(BYTE), // c2s_syncend,
  116. -1, // c2s_loadplayer,
  117. -1, // sizeof(NEW_PLAYER_COMMAND)// c2s_newplayer,
  118. -1, // c2s_removeplayer,
  119. -1, // c2s_requestworld,
  120. -1, // c2s_requestplayer,
  121. sizeof(NPC_REQUEST_COMMAND),// c2s_requestnpc,
  122. sizeof(OBJ_CLIENT_SYNC_ADD),// c2s_requestobj,
  123. sizeof(NPC_WALK_COMMAND), // c2s_npcwalk,
  124. sizeof(NPC_RUN_COMMAND), // c2s_npcrun,
  125. sizeof(NPC_SKILL_COMMAND), // c2s_npcskill,
  126. sizeof(NPC_JUMP_COMMAND), // c2s_npcjump,
  127. -1, // c2s_npctalk,
  128. -1, // c2s_npchurt,
  129. -1, // c2s_npcdeath,
  130. -1, // c2s_playertalk,
  131. sizeof(PLAYER_APPLY_TEAM_INFO), // c2s_teamapplyinfo,
  132. sizeof(PLAYER_APPLY_CREATE_TEAM), // c2s_teamapplycreate,
  133. sizeof(PLAYER_TEAM_OPEN_CLOSE), // c2s_teamapplyopenclose,
  134. sizeof(PLAYER_APPLY_ADD_TEAM), // c2s_teamapplyadd,
  135. sizeof(PLAYER_ACCEPT_TEAM_MEMBER), // c2s_teamacceptmember,
  136. sizeof(PLAYER_APPLY_LEAVE_TEAM), // c2s_teamapplyleave,
  137. sizeof(PLAYER_TEAM_KICK_MEMBER), // c2s_teamapplykickmember,
  138. sizeof(PLAYER_APPLY_TEAM_CHANGE_CAPTAIN), // c2s_teamapplychangecaptain,
  139. sizeof(PLAYER_APPLY_TEAM_DISMISS), // c2s_teamapplydismiss,
  140. sizeof(PLAYER_SET_PK), // c2s_playerapplysetpk,
  141. sizeof(PLAYER_APPLY_FACTION_DATA), // c2s_playerapplyfactiondata,
  142. -1,//sizeof(PLAYER_SEND_CHAT_COMMAND), // c2s_playersendchat,
  143. sizeof(PLAYER_ADD_BASE_ATTRIBUTE_COMMAND), // c2s_playeraddbaseattribute
  144. sizeof(PLAYER_ADD_SKILL_POINT_COMMAND), // c2s_playerapplyaddskillpoint
  145. sizeof(PLAYER_EAT_ITEM_COMMAND), // c2s_playereatitem
  146. sizeof(PLAYER_PICKUP_ITEM_COMMAND), // c2s_playerpickupitem
  147. sizeof(PLAYER_MOVE_ITEM_COMMAND), // c2s_playermoveitem
  148. sizeof(PLAYER_SELL_ITEM_COMMAND), // c2s_sellitem
  149. sizeof(PLAYER_BUY_ITEM_COMMAND), // c2s_buyitem
  150. sizeof(PLAYER_THROW_AWAY_ITEM_COMMAND), // c2s_playerthrowawayitem
  151. sizeof(PLAYER_SELECTUI_COMMAND), // c2s_playerselui,
  152. sizeof(CHAT_SET_CHANNEL_COMMAND), // c2s_chatsetchannel
  153. -1,//sizeof(CHAT_APPLY_ADD_FRIEND_COMMAND), // c2s_chatapplyaddfriend
  154. sizeof(CHAT_ADD_FRIEND_COMMAND), // c2s_chataddfriend
  155. sizeof(CHAT_REFUSE_FRIEND_COMMAND), // c2s_chatrefusefriend
  156. sizeof(tagDBSelPlayer), // c2s_dbplayerselect
  157. sizeof(CHAT_APPLY_RESEND_ALL_FRIEND_NAME_COMMAND),// c2s_chatapplyresendallfriendname
  158. sizeof(CHAT_APPLY_SEND_ONE_FRIEND_NAME_COMMAND),// c2s_chatapplysendonefriendname
  159. sizeof(CHAT_DELETE_FRIEND_COMMAND), // c2s_chatdeletefriend
  160. sizeof(CHAT_REDELETE_FRIEND_COMMAND), // c2s_chatredeletefriend
  161. -1, // TRADE_APPLY_OPEN_COMMAND // c2s_tradeapplystateopen
  162. sizeof(TRADE_APPLY_CLOSE_COMMAND), // c2s_tradeapplystateclose
  163. sizeof(TRADE_APPLY_START_COMMAND), // c2s_tradeapplystart
  164. sizeof(TRADE_MOVE_MONEY_COMMAND), // c2s_trademovemoney
  165. sizeof(TRADE_DECISION_COMMAND), // c2s_tradedecision
  166. sizeof(PLAYER_DIALOG_NPC_COMMAND), // c2s_dialognpc
  167. sizeof(TEAM_INVITE_ADD_COMMAND), // c2s_teaminviteadd
  168. sizeof(SKILL_CHANGEAURASKILL_COMMAND), // c2s_changeauraskill
  169. sizeof(TEAM_REPLY_INVITE_COMMAND), // c2s_teamreplyinvite
  170. sizeof(PING_CLIENTREPLY_COMMAND), // c2s_ping
  171. sizeof(NPC_SIT_COMMAND), // c2s_npcsit
  172. sizeof(OBJ_MOUSE_CLICK_SYNC), // c2s_objmouseclick
  173. sizeof(STORE_MONEY_COMMAND), // c2s_storemoney
  174. sizeof(NPC_REVIVE_COMMAND), // c2s_playerrevive
  175. sizeof(TRADE_REPLY_START_COMMAND), // c2s_tradereplystart
  176. sizeof(PK_APPLY_NORMAL_FLAG_COMMAND), // c2s_pkapplychangenormalflag
  177. sizeof(PK_APPLY_ENMITY_COMMAND), // c2s_pkapplyenmity
  178. sizeof(VIEW_EQUIP_COMMAND), // c2s_viewequip
  179. sizeof(LADDER_QUERY), // c2s_ladderquery
  180. sizeof(ITEM_REPAIR), // c2s_repairitem
  181. #endif
  182. };
  183. void g_InitProtocol()
  184. {
  185. #ifdef _SERVER
  186. g_nProtocolSize[c2s_extend - c2s_gameserverbegin - 1] = -1;
  187. g_nProtocolSize[c2s_extendchat - c2s_gameserverbegin - 1] = -1;
  188. g_nProtocolSize[c2s_extendfriend - c2s_gameserverbegin - 1] = -1;
  189. g_nProtocolSize[c2s_extendtong - c2s_gameserverbegin - 1] = -1;
  190. #else
  191. g_nProtocolSize[s2c_extend - s2c_clientbegin - 1] = -1;
  192. g_nProtocolSize[s2c_extendchat - s2c_clientbegin - 1] = -1;
  193. g_nProtocolSize[s2c_extendfriend - s2c_clientbegin - 1] = -1;
  194. g_nProtocolSize[s2c_extendtong - s2c_clientbegin - 1] = -1;
  195. #endif
  196. }
  197. #ifndef _SERVER
  198. //#include "KNetClient.h"
  199. #include "../../Headers/IClient.h"
  200. #include "KCore.h"
  201. void SendClientCmdRun(int nX, int nY)
  202. {
  203. NPC_RUN_COMMAND NetCommand;
  204. NetCommand.ProtocolType = (BYTE)c2s_npcrun;
  205. NetCommand.nMpsX = nX;
  206. NetCommand.nMpsY = nY;
  207. if (g_pClient)
  208. g_pClient->SendPackToServer((BYTE*)&NetCommand, sizeof(NetCommand));
  209. }
  210. void SendClientCmdWalk(int nX, int nY)
  211. {
  212. NPC_WALK_COMMAND NetCommand;
  213. NetCommand.ProtocolType = (BYTE)c2s_npcwalk;
  214. NetCommand.nMpsX = nX;
  215. NetCommand.nMpsY = nY;
  216. if (g_pClient)
  217. g_pClient->SendPackToServer((BYTE*)&NetCommand, sizeof(NetCommand));
  218. }
  219. void SendClientCmdSkill(int nSkillID, int nX, int nY)
  220. {
  221. NPC_SKILL_COMMAND NetCommand;
  222. NetCommand.ProtocolType = (BYTE)c2s_npcskill;
  223. NetCommand.nSkillID = nSkillID;
  224. NetCommand.nMpsX = nX;
  225. NetCommand.nMpsY = nY;
  226. if (g_pClient)
  227. g_pClient->SendPackToServer((BYTE*)&NetCommand, sizeof(NPC_SKILL_COMMAND));
  228. }
  229. void SendClientCmdRequestNpc(int nID)
  230. {
  231. NPC_REQUEST_COMMAND NpcRequest;
  232. NpcRequest.ProtocolType = c2s_requestnpc;
  233. NpcRequest.ID = nID;
  234. if (g_pClient)
  235. g_pClient->SendPackToServer((BYTE*)&NpcRequest, sizeof(NPC_REQUEST_COMMAND));
  236. }
  237. void SendClientCmdSell(int nId)
  238. {
  239. if (Player[CLIENT_PLAYER_INDEX].m_ItemList.IsLockOperation())
  240. return;
  241. PLAYER_SELL_ITEM_COMMAND PlayerSell;
  242. PlayerSell.ProtocolType = c2s_playersellitem;
  243. PlayerSell.m_ID = nId;
  244. if (g_pClient)
  245. g_pClient->SendPackToServer((BYTE*)&PlayerSell, sizeof(PLAYER_SELL_ITEM_COMMAND));
  246. Player[CLIENT_PLAYER_INDEX].m_ItemList.LockOperation();
  247. }
  248. void SendClientCmdBuy(int nBuyIdx, int nPlace, int nX, int nY)
  249. {
  250. if (Player[CLIENT_PLAYER_INDEX].m_ItemList.IsLockOperation())
  251. return;
  252. PLAYER_BUY_ITEM_COMMAND PlayerBuy;
  253. PlayerBuy.ProtocolType = c2s_playerbuyitem;
  254. PlayerBuy.m_BuyIdx = (BYTE)nBuyIdx;
  255. PlayerBuy.m_Place = (BYTE)nPlace;
  256. PlayerBuy.m_X = (BYTE)nX;
  257. PlayerBuy.m_Y = (BYTE)nY;
  258. if (g_pClient)
  259. g_pClient->SendPackToServer((BYTE*)&PlayerBuy, sizeof(PLAYER_BUY_ITEM_COMMAND));
  260. Player[CLIENT_PLAYER_INDEX].m_ItemList.LockOperation();
  261. }
  262. //void SendClientCmdPing()
  263. //{
  264. // PING_COMMAND PingCmd;
  265. //
  266. // PingCmd.ProtocolType = c2s_ping;
  267. // PingCmd.m_dwTime = GetTickCount();
  268. // if (g_pClient && g_bPingReply)
  269. // {
  270. // g_pClient->SendPackToServer((BYTE*)&PingCmd, sizeof(PING_COMMAND));
  271. // g_bPingReply = FALSE;
  272. // }
  273. //}
  274. void SendClientCmdSit(int nSitFlag)
  275. {
  276. NPC_SIT_COMMAND SitCmd;
  277. SitCmd.ProtocolType = c2s_npcsit;
  278. SitCmd.m_btSitFlag = (nSitFlag != 0);
  279. if (g_pClient)
  280. g_pClient->SendPackToServer((BYTE*)&SitCmd, sizeof(NPC_SIT_COMMAND));
  281. }
  282. void SendClientCmdJump(int nMpsX, int nMpsY)
  283. {
  284. NPC_JUMP_COMMAND JumpCmd;
  285. JumpCmd.nMpsX = nMpsX;
  286. JumpCmd.nMpsY = nMpsY;
  287. JumpCmd.ProtocolType = c2s_npcjump;
  288. if (g_pClient)
  289. g_pClient->SendPackToServer((BYTE*)&JumpCmd, sizeof(NPC_JUMP_COMMAND));
  290. }
  291. void SendObjMouseClick(int nObjID, DWORD dwRegionID)
  292. {
  293. OBJ_MOUSE_CLICK_SYNC sObj;
  294. sObj.ProtocolType = c2s_objmouseclick;
  295. sObj.m_dwRegionID = dwRegionID;
  296. sObj.m_nObjID = nObjID;
  297. if (g_pClient)
  298. g_pClient->SendPackToServer((BYTE*)&sObj, sizeof(OBJ_MOUSE_CLICK_SYNC));
  299. }
  300. void SendClientCmdStoreMoney(int nDir, int nMoney)
  301. {
  302. STORE_MONEY_COMMAND StoreMoneyCmd;
  303. StoreMoneyCmd.ProtocolType = c2s_storemoney;
  304. StoreMoneyCmd.m_byDir = (BYTE)nDir;
  305. StoreMoneyCmd.m_dwMoney = nMoney;
  306. if (g_pClient)
  307. g_pClient->SendPackToServer((BYTE*)&StoreMoneyCmd, sizeof(STORE_MONEY_COMMAND));
  308. }
  309. //void SendClientCmdRevive(int nReviveType)
  310. //{
  311. // NPC_REVIVE_COMMAND ReviveCmd;
  312. //
  313. // ReviveCmd.ProtocolType = c2s_playerrevive;
  314. // ReviveCmd.ReviveType = nReviveType;
  315. // if (g_pClient)
  316. // g_pClient->SendPackToServer((BYTE *)&ReviveCmd, sizeof(NPC_REVIVE_COMMAND));
  317. //}
  318. void SendClientCmdRevive()
  319. {
  320. NPC_REVIVE_COMMAND ReviveCmd;
  321. ReviveCmd.ProtocolType = c2s_playerrevive;
  322. if (g_pClient)
  323. g_pClient->SendPackToServer((BYTE *)&ReviveCmd, sizeof(NPC_REVIVE_COMMAND));
  324. }
  325. void SendClientCmdMoveItem(void* pDownPos, void* pUpPos)
  326. {
  327. if (!pDownPos || !pUpPos)
  328. return;
  329. if (Player[CLIENT_PLAYER_INDEX].m_ItemList.IsLockOperation())
  330. return;
  331. ItemPos* pos1 = (ItemPos *)pDownPos;
  332. ItemPos* pos2 = (ItemPos *)pUpPos;
  333. PLAYER_MOVE_ITEM_COMMAND sMove;
  334. sMove.ProtocolType = c2s_playermoveitem;
  335. sMove.m_btDownPos = pos1->nPlace;
  336. sMove.m_btDownX = pos1->nX;
  337. sMove.m_btDownY = pos1->nY;
  338. sMove.m_btUpPos = pos2->nPlace;
  339. sMove.m_btUpX = pos2->nX;
  340. sMove.m_btUpY = pos2->nY;
  341. if (g_pClient)
  342. g_pClient->SendPackToServer(&sMove, sizeof(PLAYER_MOVE_ITEM_COMMAND));
  343. Player[CLIENT_PLAYER_INDEX].m_ItemList.LockOperation();
  344. }
  345. void SendClientCmdQueryLadder(DWORD dwLadderID)
  346. {
  347. if (dwLadderID <= enumLadderBegin || dwLadderID >= enumLadderEnd)
  348. return;
  349. if (g_pClient)
  350. {
  351. LADDER_QUERY LadderQuery;
  352. LadderQuery.ProtocolType = c2s_ladderquery;
  353. LadderQuery.dwLadderID = dwLadderID;
  354. g_pClient->SendPackToServer(&LadderQuery, sizeof(LADDER_QUERY));
  355. }
  356. }
  357. void SendClientCmdRepair(DWORD dwID)
  358. {
  359. ITEM_REPAIR ItemRepair;
  360. ItemRepair.ProtocolType = c2s_repairitem;
  361. ItemRepair.dwItemID = dwID;
  362. if (g_pClient)
  363. g_pClient->SendPackToServer((BYTE*)&ItemRepair, sizeof(ITEM_REPAIR));
  364. }
  365. #endif
  366. #ifdef _SERVER
  367. //#include "KNetServer.h"
  368. //#include "NetWorkJXServer.h"
  369. void SendServerCmdWalk(int nX, int nY)
  370. {
  371. }
  372. void SendServerCmdRun(int nX, int nY)
  373. {
  374. }
  375. #endif