314bc5df
zhengshouren
提交服务器初始代码
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
local _M = {}
local redisproxy = redisproxy
function _M.clientRequest(agent, data)
local msg = MsgPack.unpack(data)
local role = agent.role
local action = _M[msg.cmd]
local bin = MsgPack.pack({ cmd = "指令失败" })
if not action then
SendPacket(actionCodes.Gm_receiveResponse, bin)
return true
end
local ret = action(role, msg)
bin = MsgPack.pack({ cmd = ret })
SendPacket(actionCodes.Gm_receiveResponse, bin)
return true
end
|
0a07bdd9
zhouahaihai
角色升级 。gm
|
18
19
20
|
function _M.hero(role, pms)
local heroType = tonum(pms.pm1)
|
056c01a0
zhouhaihai
简化装备
|
21
22
23
|
if not role:addHero({type = heroType}) then
return "失败"
end
|
0a07bdd9
zhouahaihai
角色升级 。gm
|
24
25
26
|
return "成功"
end
|
43cc5f51
gaofengduan
调整 equip 数据结构
|
27
28
29
30
31
32
33
34
|
function _M.equip(role, pms)
local typ = tonum(pms.pm1)
local level = tonum(pms.pm2)
local count = tonum(pms.pm3)
role:addEquip({type = typ,level = level,count = count})
return "成功"
end
|
ad484303
gaofengduan
add rune
|
35
36
37
38
39
40
41
|
function _M.rune(role, pms)
local typ = tonum(pms.pm1)
local id = tonum(pms.pm2)
local result = role:addRune({type = typ,id = id})
return result
end
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
42
|
function _M.get(role, pms)
|
747f05a1
gaofengduan
add gm get all
|
43
|
if pms.pm1 == "ALL" then
|
056c01a0
zhouhaihai
简化装备
|
44
45
46
|
for itemId = 1, 100 do
if csvdb["itemCsv"][itemId] then
role:award({[itemId] = 1000000})
|
747f05a1
gaofengduan
add gm get all
|
47
48
|
end
end
|
3c8a6b8a
zhouhaihai
get equip
|
49
50
51
52
53
54
|
elseif pms.pm1 == "EQUIP" then
for itemId = 7000 , 8000 do
if csvdb["itemCsv"][itemId] then
role:award({[itemId] = 100})
end
end
|
966034ca
zhouhaihai
获取碎片零件gm
|
55
|
elseif pms.pm1 == "RUNE" then
|
58751698
zhouhaihai
修改id 区间
|
56
|
for itemId = 2000 , 3000 do
|
966034ca
zhouhaihai
获取碎片零件gm
|
57
|
if csvdb["itemCsv"][itemId] then
|
a0013f0b
zhouhaihai
零件分批推送
|
58
|
role:award({[itemId] = 1})
|
966034ca
zhouhaihai
获取碎片零件gm
|
59
60
61
62
63
64
65
66
|
end
end
elseif pms.pm1 == "FRAG" then
for itemId = 100 , 400 do
if csvdb["itemCsv"][itemId] then
role:award({[itemId] = 100})
end
end
|
747f05a1
gaofengduan
add gm get all
|
67
68
69
70
71
|
else
local itemId = tonum(pms.pm1)
if not csvdb["itemCsv"][itemId] then
return "物品不存在"
end
|
ee999bde
zhouhaihai
零件优化
|
72
|
local count = tonum(pms.pm2, 1)
|
747f05a1
gaofengduan
add gm get all
|
73
|
role:award({[itemId] = count})
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
74
|
end
|
8c74292c
zhouahaihai
增加item 以及 角色突破
|
75
76
77
|
return "成功"
end
|
4b7c7c96
zhouahaihai
增加 清空 挂机 冒险gm 角色经验
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
function _M.advc(role, pms)
role:updateProperty({field = "advInfo", value = {}})
role:updateProperty({field = "advItems", value = ""})
role:updateProperty({field = "advTeam", value = {}})
role.advData = nil
return "成功"
end
function _M.idlec(role, pms)
role:updateProperty({field = "hangTeam", value = {}})
role:updateProperty({field = "hangInfo", value = {}})
role:updateProperty({field = "hangBag", value = {}})
role.advData = nil
return "成功"
end
|
314bc5df
zhengshouren
提交服务器初始代码
|
94
|
return _M
|