Blame view

src/ProtocolCode.lua 2.15 KB
314bc5df   zhengshouren   提交服务器初始代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  -- 协议号
  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,
0a07bdd9   zhouahaihai   角色升级 。gm
18
  	Role_syncTimeRpc = 104,
314bc5df   zhengshouren   提交服务器初始代码
19
20
  	Role_updateProperty = 105,
  	Role_updateProperties = 106,
8c74292c   zhouahaihai   增加item 以及 角色突破
21
  	Role_updateItems = 107,
6947e382   zhouahaihai   好感度, 皮肤
22
  	Role_changeUpdate = 108,
23d89d13   zhouahaihai   冒险 结构
23
  	Role_pipelining = 109,
312b9db5   zhouahaihai   背包
24
25
  	Role_saleItemRpc = 110,
  	Role_openItemRpc = 111,
43cc5f51   gaofengduan   调整 equip 数据结构
26
27
  	Role_updateEquip = 112,
  	Role_updateRune = 113,
23d89d13   zhouahaihai   冒险 结构
28
29
  
  	Adv_startAdvRpc = 151,
46fac6f1   zhouahaihai   酱料
30
31
32
33
  	Adv_roleFormatRpc = 152,
  	Adv_clickBlockRpc = 153,
  	Adv_useItemRpc = 154,
  	Adv_useSkillRpc = 155,
ec87b4a5   zhouahaihai   冒险 完善
34
  	Adv_exitAdvRpc = 156,
ae20365b   suhongyang   Revert "修改冒险战斗逻辑"
35
  	Adv_nextTurnRpc = 157,
42f2d1d3   suhongyang   战斗内技能序列逻辑
36
  	Adv_battleSkillRpc = 158,
314bc5df   zhengshouren   提交服务器初始代码
37
38
39
  
  	Hero_loadInfos = 201,
  	Hero_updateProperty = 202,
0a07bdd9   zhouahaihai   角色升级 。gm
40
  	Hero_levelUpRpc = 203,
8c74292c   zhouahaihai   增加item 以及 角色突破
41
  	Hero_breakRpc = 204,
997cbdfe   zhouahaihai   技能养成
42
43
44
  	Hero_wakeRpc = 205,
  	Hero_skillUpRpc = 206,
  	Hero_talentRpc = 207,
be9c9ca6   zhouahaihai   角色评论
45
46
47
48
  	Hero_likeHeroRpc = 208,
  	Hero_commentHeroRpc = 209,
  	Hero_getCommentsRpc = 210,
  	Hero_likeCommentRpc = 211,
6947e382   zhouahaihai   好感度, 皮肤
49
50
51
  	Hero_loveItemRpc = 212,
  	Hero_loveTaskRpc = 213,
  	Hero_changeSkinRpc = 214,
312b9db5   zhouahaihai   背包
52
  	Hero_createHeroRpc = 215,
43cc5f51   gaofengduan   调整 equip 数据结构
53
54
  	Hero_referEquipsRpc = 216,
  	Hero_referRunesRpc = 217,
23d89d13   zhouahaihai   冒险 结构
55
  
384bb077   zhouahaihai   挂机
56
57
58
59
60
  	Hang_startRpc = 251,
  	Hang_checkRpc = 252,
  	Hang_startBattleRpc = 253,
  	Hang_endBattleRpc = 254,
  	Hang_roleFormatRpc = 255,
5af8b4aa   zhouahaihai   挂机down
61
  	Hang_getRewardRpc = 256,
9962b061   zhouahaihai   补充 挂机
62
  	Hang_quickRpc = 257,
1607a7f0   zhouahaihai   冒险事件 new
63
64
  	Hang_getRewardItemRpc = 258,
  	Hang_getRewardCoinRpc = 259,
384bb077   zhouahaihai   挂机
65
  
87cc3a35   zhengshouren   餐厅建筑升级逻辑
66
67
68
69
70
  	Diner_updateProperty = 300,
  	Diner_addSellRpc = 301,
  	Diner_getSellRewardRpc = 302,
  	Diner_levelUpRpc = 303,
  	Diner_talentUpRpc = 304,
7d44dca2   zhengshouren   支援技能升级逻辑
71
  	Diner_skillUpRpc = 305,
1ab9458f   gaofengduan   add 下菜操作
72
  	Diner_removeSellRpc = 306,
4864d579   zhengshouren   领取任务,锁定任务,获得特殊任务
73
  	Diner_lockTaskRpc = 307,
fdb86cad   gaofengduan   fix diner task
74
75
  	Diner_updateTaskRpc = 308,
  	Diner_refreshTaskRpc = 309,
2050d40d   gaofengduan   add diner expedit...
76
  	Diner_expediteSellRpc = 310,
4288160b   gaofengduan   add Diner_getGree...
77
  	Diner_getGreenhouseRpc = 311,
9c525cf9   gaofengduan   add car smithy
78
79
80
  
  	Car_makePotionRpc = 400,
  	Car_equipUpRpc = 401,
fb321075   gaofengduan   add rune up
81
  	Car_runeUpRpc = 402,
314bc5df   zhengshouren   提交服务器初始代码
82
83
84
85
86
87
88
89
90
91
92
93
94
95
  }
  
  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