ProtocolCode.lua
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
-- 协议号
actionCodes = {
Sys_heartBeat = 1,
Sys_errorMsg = 3,
Sys_innerErrorMsg = 4,
Sys_commonNotice = 5,
Sys_maintainNotice = 6,
Sys_kickdown = 7,
Sys_runningHorse = 8,
Gm_clientRequest = 20,
Gm_receiveResponse = 21,
Role_notifyNewEvent = 100,
Role_queryLoginRpc = 101,
Role_createRpc = 102,
Role_loginRpc = 103,
Role_syncTimeRpc = 104,
Role_updateProperty = 105,
Role_updateProperties = 106,
Role_updateItems = 107,
Role_changeUpdate = 108,
Role_pipelining = 109,
Role_saleItemRpc = 110,
Role_openItemRpc = 111,
Role_loadRunes = 112,
Role_updateRune = 113,
Role_storyBookRewardRpc = 114,
Role_unLockStoryBookRpc = 115,
Role_openTimeBoxRpc = 116,
Adv_startAdvRpc = 151,
Adv_roleFormatRpc = 152,
Adv_clickBlockRpc = 153,
Adv_useItemRpc = 154,
Adv_usePotionRpc = 155,
Adv_exitAdvRpc = 156,
Hero_loadInfos = 201,
Hero_updateProperty = 202,
Hero_levelUpRpc = 203,
Hero_breakRpc = 204,
Hero_wakeRpc = 205,
Hero_skillUpRpc = 206,
Hero_talentRpc = 207,
Hero_likeHeroRpc = 208,
Hero_commentHeroRpc = 209,
Hero_getCommentsRpc = 210,
Hero_likeCommentRpc = 211,
Hero_loveItemRpc = 212,
Hero_loveTaskRpc = 213,
Hero_changeSkinRpc = 214,
Hero_createHeroRpc = 215,
Hero_referEquipsRpc = 216,
Hero_referRunesRpc = 217,
Hero_createHeroRandomRpc = 218,
Hero_getResetRewardRpc = 219,
Hang_startRpc = 251,
Hang_checkRpc = 252,
Hang_startBattleRpc = 253,
Hang_endBattleRpc = 254,
Hang_roleFormatRpc = 255,
Hang_getRewardRpc = 256,
Hang_quickRpc = 257,
Hang_getRewardItemRpc = 258,
Hang_getRewardCoinRpc = 259,
Diner_updateProperty = 300,
Diner_addSellRpc = 301,
Diner_getSellRewardRpc = 302,
Diner_levelUpRpc = 303,
Diner_talentUpRpc = 304,
Diner_skillUpRpc = 305,
Diner_removeSellRpc = 306,
Diner_lockTaskRpc = 307,
Diner_updateTaskRpc = 308,
Diner_refreshTaskRpc = 309,
Diner_expediteSellRpc = 310,
Diner_getGreenhouseRpc = 311,
Car_makePotionRpc = 400,
Car_equipUpRpc = 401,
Car_runeUpRpc = 402,
Car_saleEquipRpc = 403,
Car_saleRuneRpc = 404,
}
rpcResponseBegin = 10000
actionHandlers = {}
for key, value in pairs(actionCodes) do
local suffix = string.sub(key, -3, -1)
local handlerName = string.gsub(key, "_", ".")
if suffix == "Rpc" then
actionHandlers[value + rpcResponseBegin] = handlerName .. "Response"
end
actionHandlers[value] = string.gsub(key, "_", ".")
end