Blame view

src/ProtocolCode.lua 942 Bytes
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,
314bc5df   zhengshouren   提交服务器初始代码
22
23
24
  
  	Hero_loadInfos = 201,
  	Hero_updateProperty = 202,
0a07bdd9   zhouahaihai   角色升级 。gm
25
  	Hero_levelUpRpc = 203,
8c74292c   zhouahaihai   增加item 以及 角色突破
26
  	Hero_breakRpc = 204,
997cbdfe   zhouahaihai   技能养成
27
28
29
  	Hero_wakeRpc = 205,
  	Hero_skillUpRpc = 206,
  	Hero_talentRpc = 207,
314bc5df   zhengshouren   提交服务器初始代码
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  }
  
  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