Gm.lua 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940
  1. local Config = require("Config")
  2. local Util = require("common.Util")
  3. local Log = require("common.Log")
  4. local Msg = require("core.Msg")
  5. local ObjHuman = require("core.ObjHuman")
  6. local BagLogic = require("bag.BagLogic")
  7. local Broadcast = require("broadcast.Broadcast")
  8. local Util = require("common.Util")
  9. local InnerMsg = require("core.InnerMsg")
  10. local CommonDB = require("common.CommonDB")
  11. local JjcDB = require("jjc.JjcDB")
  12. local VipLogic = require("vip.VipLogic")
  13. local VipExcel = require("excel.vip")
  14. local GMExcel = require("excel.gm")
  15. local RoleLogic = require("role.RoleLogic")
  16. local UnionDBLogic = require("union.UnionDBLogic")
  17. local CombatPosLogic = require("combat.CombatPosLogic")
  18. local CombatDefine = require("combat.CombatDefine")
  19. local ItemDefine = require("bag.ItemDefine")
  20. local MiddleConnect = require("middle.MiddleConnect")
  21. local BuyLogic = require("topup.BuyLogic")
  22. local WarOrder = require("shop.WarOrder")
  23. local GiftLogic = require("topup.GiftLogic")
  24. local HeroSkinLogic = require("present.HeroSkinLogic")
  25. local DrawCardLogic = require("drawCard.DrawCardLogic")
  26. local WeekendLoopActManger = require("WeekendLoopActivity.WeekendLoopActManager")
  27. d3 = {}
  28. local function send(human, err)
  29. local mm = Msg.gc.GC_CHAT
  30. mm.item.msgType = 3
  31. mm.item.targetUuid = ""
  32. mm.item.sendTime = os.time()
  33. mm.item.msg = tostring(err)
  34. mm.item.vipLv = human.db.vipLv or 0
  35. mm.item.videoUuid = ""
  36. mm.item.isJson = 0
  37. mm.item.unionFrame = 0
  38. local union = {}
  39. if human.db.unionUuid ~= nil then
  40. union = UnionDBLogic.getUnion(human.db.unionUuid)
  41. end
  42. RoleLogic.getRoleBase(human,mm.item.roleBase)
  43. mm.item.label = human.db.throneLabel or 0
  44. Msg.send(mm, human.fd)
  45. end
  46. -- 直接调用gm命令
  47. function execGm(human, cmd,pos)
  48. print("直接调用gm命令",cmd,pos)
  49. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, pos)
  50. d3[cmd](human, tonumber(pos) or pos)
  51. return true
  52. end
  53. function checkGm(human, str)
  54. if not Config.IS_USE_GM_CMD and human.db.gm == nil then
  55. return
  56. end
  57. local pos = string.find(str, " ", 1, true)
  58. local cmd = string.sub(str, 1, pos and pos - 1)
  59. if not Config.IS_USE_GM_CMD then
  60. if human.db.gm == 1 and not GmControl[cmd] then -- 一级权限的gm只能使用部分gm命令
  61. send(human, "not permit for this gm cmd!")
  62. return true
  63. end
  64. if human.db.gm == 100 then -- 新手引导员不能使用gm命令
  65. return
  66. end
  67. end
  68. if not d3[cmd] then
  69. return
  70. end
  71. local arg = string.sub(str, #cmd + 2)
  72. Log.write(Log.LOGID_OSS_GM_CODE, human.db._id, human.db.account, human.db.name, cmd, arg)
  73. d3[cmd](human, tonumber(arg) or arg)
  74. return true
  75. end
  76. function d3.addJifen(human,val)
  77. local v = tonumber(val)
  78. if not v then
  79. print("param invalid")
  80. return
  81. end
  82. return DrawCardLogic.getJifen(human,v)
  83. end
  84. function d3.unlockOrder(human,orderType)
  85. local t = tonumber(orderType)
  86. if not t then
  87. print("invalid orderType ",orderType)
  88. return
  89. end
  90. return WarOrder.warOrderUnlock(human,t)
  91. end
  92. function d3.buyGift(human,giftID)
  93. local t = assert(tonumber(giftID),"invalid gift id")
  94. return GiftLogic.buy(human,giftID)
  95. end
  96. function d3.heroSkinActBuy(human,id)
  97. local t = assert(tonumber(id),"invalid skinAct id")
  98. return HeroSkinLogic.buy(human,t)
  99. end
  100. function d3.heroadd(human,val)
  101. if val == nil then return end
  102. local tb = Util.split(val, " ")
  103. local id = tonumber(tb[1])
  104. local cnt = tonumber(tb[2])
  105. local lv = tonumber(tb[3])
  106. local star = tonumber(tb[4])
  107. if not (id and cnt) then return end
  108. for i = 1, cnt do
  109. local heroGrid = require("hero.HeroGrid").createHeroGrid(id , star)
  110. if not heroGrid then break end
  111. local skinLogic = require("skin.SkinLogic")
  112. local skinOn = skinLogic.checkHeroSkinById(human,id)
  113. if skinOn then
  114. heroGrid.skinOn = skinOn
  115. end
  116. local attrConfig = require("hero.HeroDefine").getAttrConfig(id, heroGrid.star)
  117. if not attrConfig then return end
  118. local quality = require("hero.HeroGrid").getMaxQualityByLv(heroGrid.star, lv)
  119. local maxLv = require("hero.HeroGrid").getMaxLv(heroGrid.star, quality)
  120. heroGrid.lv = math.min(maxLv, lv or 0)
  121. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  122. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  123. end
  124. end
  125. function d3.herodel(human,val)
  126. if val == nil then return end
  127. local pos = string.find(val, " ", 1, true)
  128. if pos == nil then return end
  129. local index = tonumber(string.sub(val, 1, pos - 1))
  130. local cnt= tonumber(string.sub(val,pos+1,#val))
  131. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  132. end
  133. function d3.herodelAll(human,val)
  134. for index = 1, human.db.heroBag[0]do
  135. require("hero.HeroLogic").delHeroByIndex(human,index,"gm")
  136. end
  137. end
  138. function d3.itemadd(human,val)
  139. if val == nil then return end
  140. local pos = string.find(val, " ", 1, true)
  141. if pos == nil then return end
  142. local id = tonumber(string.sub(val, 1, pos - 1))
  143. if not id then
  144. local name = string.sub(val, 1, pos - 1)
  145. local ItemExcel = require("excel.item").item
  146. for k,v in pairs(ItemExcel) do
  147. if v.name == name then
  148. id = k
  149. break
  150. end
  151. end
  152. end
  153. if not id then
  154. local name = string.sub(val,1,pos - 1)
  155. local EquipExcel = require("excel.equip").equip
  156. for k,v in pairs(EquipExcel) do
  157. if v.name == name then
  158. id = k
  159. break
  160. end
  161. end
  162. end
  163. if not id then
  164. return
  165. end
  166. local EquipExcel = require("excel.equip").equip
  167. if EquipExcel[id] then
  168. local cnt= tonumber(string.sub(val,pos+1,pos + 2))
  169. local rare= tonumber(string.sub(val,pos+2,#val))
  170. require("bag.BagLogic").addItem(human, id, cnt, "gm", nil, rare)
  171. human.getEquip = nil
  172. else
  173. -- 分开是因为 常规道具 给不了
  174. local cnt= tonumber(string.sub(val,pos+1,#val))
  175. require("bag.BagLogic").addItem(human,id,cnt,"gm")
  176. end
  177. end
  178. -- 删除道具
  179. function d3.itemdel(human,val)
  180. if val == nil then return end
  181. local pos = string.find(val, " ", 1, true)
  182. if pos == nil then return end
  183. local id = tonumber(string.sub(val, 1, pos - 1))
  184. local cnt= tonumber(string.sub(val,pos+1,#val))
  185. require("bag.BagLogic").delItem(human,id,cnt,"gm")
  186. end
  187. function d3.qingbaoMax(human)
  188. require("bar.BarTaskLogic").addBarQingBao(human, 10000)
  189. end
  190. function d3.maxbattle(human, val)
  191. val = val + 0
  192. human.db.battleID = val
  193. human.db.guajiID = val - 1
  194. local BRoleLogic = require("billboard.BRoleLogic")
  195. local BillboardDefine = require("billboard.BillboardDefine")
  196. BRoleLogic.updateData(BillboardDefine.TYPE_BATTLE, human.db)
  197. end
  198. function d3.dbsave(human)
  199. ObjHuman.save(human)
  200. end
  201. -- 设置当前金币
  202. function d3.jinbi(human, val)
  203. val = val + 0
  204. ObjHuman.updateJinbi(human, val - human.db.jinbi, "gm")
  205. end
  206. -- 设置钻石
  207. function d3.zuanshi(human, val)
  208. val = val + 0
  209. if val > human.db.zuanshi then
  210. print("234234234",val)
  211. ObjHuman.addZuanshi(human, val - human.db.zuanshi, "gm")
  212. else
  213. ObjHuman.decZuanshi(human, val - human.db.zuanshi, "gm")
  214. end
  215. end
  216. --添加邮件
  217. function d3.mail(human,val)
  218. local param = Util.split(val, " ")
  219. local mailtype = tonumber(param[1])
  220. local title = param[2]
  221. local content = param[3]
  222. local max = #param
  223. local count = (type(param[max]) == "number") and param[max] or 1
  224. local items
  225. if param[4] then
  226. items = {}
  227. for i = 4,max-1 do
  228. items[#items + 1] = {tonumber(param[i]),math.floor(math.random(1,10))}
  229. end
  230. end
  231. if not (mailtype == 1 or mailtype == 2) or not title or not content then
  232. send(human, "参数错误 "..type.." "..title.." "..content.." "..#items)
  233. end
  234. local MailManager = require("mail.MailManager")
  235. for i= 1,count do
  236. MailManager.add(mailtype,human.db._id,title,content,items,mailtype == 2 and [[测试用户]])
  237. end
  238. end
  239. function d3.clbag(human)
  240. human.db.bag = {}
  241. local msgRet = Msg.gc.GC_BAG_LIST
  242. msgRet.list[0] = 0
  243. Msg.send(msgRet, human.fd)
  244. end
  245. function d3.clhero(human)
  246. local HeroLogic = require("hero.HeroLogic")
  247. for i = 1, human.db.heroBag[0] do
  248. HeroLogic.delHeroByIndex(human, i, "gm")
  249. end
  250. end
  251. function d3.god(human)
  252. local GMExcelConfig = GMExcel.god[1]
  253. BagLogic.addItemList(human, GMExcelConfig.addItem, "gm")
  254. for k, v in ipairs(GMExcelConfig.addHero) do
  255. local id = tonumber(v[1])
  256. local cnt = tonumber(v[2])
  257. local lv = tonumber(v[3])
  258. local star = tonumber(v[4])
  259. local quality = require("hero.HeroGrid").getMaxQualityByLv(star, lv)
  260. for i = 1, cnt do
  261. local heroGrid = require("hero.HeroGrid").createHeroGrid(id, star)
  262. if heroGrid then
  263. heroGrid.lv = math.max(heroGrid.lv, lv or 0)
  264. heroGrid.quality = math.max(heroGrid.quality, quality or 0)
  265. require("hero.HeroLogic").addHeroByGrid(human, heroGrid, "gm")
  266. end
  267. end
  268. end
  269. --d3.viplv(human, 13)
  270. --d3.lv(human, 1)
  271. --d3.noguide(human)
  272. end
  273. function d3.wudi(human)
  274. if wudi then
  275. wudi = false
  276. Broadcast.sendErr(human, "取消无敌状态")
  277. else
  278. wudi = true
  279. Broadcast.sendErr(human, "进入无敌状态")
  280. end
  281. end
  282. -- 清空副本次数和购买次数
  283. function d3.clcopy(human)
  284. human.db.copy = nil
  285. end
  286. -- 设置等级
  287. function d3.lv(human, val)
  288. val = val + 0
  289. local lvOld = human.db.lv
  290. local lvNew = val + 0
  291. human.db.lv = lvNew
  292. ObjHuman.onLvUpCB(human,lvOld , lvNew)
  293. end
  294. -- 加经验
  295. function d3.addexp(human, val)
  296. val = val + 0
  297. ObjHuman.addExp(human, val)
  298. end
  299. -- 设置vip等级
  300. function d3.viplv(human, val)
  301. val = val + 0
  302. local oldVipLv = VipLogic.getVipLv(human)
  303. human.db.vipExp = VipExcel.vip[val] and VipExcel.vip[val].exp or 0
  304. human.db.vipLv = val
  305. VipLogic.addExp(human, 0)
  306. end
  307. -- 增加vip经验
  308. function d3.vipexp(human, val)
  309. val = val + 0
  310. VipLogic.addExp(human, val)
  311. end
  312. function d3.it1(human, value)
  313. value = tonumber(value)
  314. if not value then return end
  315. local ItemExcel = require("excel.item").item
  316. local BagLogic = require("bag.BagLogic")
  317. for itemID, cf in pairs(ItemExcel) do
  318. if cf.subType == value then
  319. BagLogic.addItem(human, itemID, 1, "gm", true)
  320. end
  321. end
  322. BagLogic.sendBagList(human)
  323. end
  324. function d3.equip(human, value)
  325. value = tonumber(value)
  326. if not value then return end
  327. local BagLogic = require("bag.BagLogic")
  328. local EquipExcel = require("excel.equip").equip
  329. for itemID in pairs(EquipExcel) do
  330. BagLogic.addItem(human, itemID, 1, "gm", true)
  331. end
  332. BagLogic.sendBagList(human)
  333. end
  334. function d3.task(human, val)
  335. if val == nil then return end
  336. local task = string.find(val, " ", 1, true)
  337. if task == nil then return end
  338. local id = tonumber(string.sub(val, 1, task - 1))
  339. local cnt= tonumber(string.sub(val,task+1,#val))
  340. local DailyTaskLogic = require("dailyTask.DailyTaskLogic")
  341. DailyTaskLogic.recordDailyTaskFinishCnt(human, id, cnt, nil)
  342. end
  343. function d3.os(human, value)
  344. value = value and tonumber(value)
  345. if value == nil then
  346. local openSvrTime = CommonDB.getServerOpenTime()
  347. if openSvrTime == 0 then
  348. Broadcast.sendErr(human, "未设置开服时间")
  349. else
  350. local tb = os.date("%Y%m%d", openSvrTime)
  351. Broadcast.sendErr(human, "当前开服时间为" .. tb)
  352. end
  353. else
  354. local now = os.time()
  355. local temp = Util.getDayStartTime(now)
  356. temp = temp - (value - 1) * 24 * 3600
  357. CommonDB.setServerOpenTime(temp)
  358. local tb = os.date("%Y%m%d", temp)
  359. Broadcast.sendErr(human, "设置当前开服时间为" .. tb)
  360. --同步中心服开服时间
  361. --[[local msgRet = InnerMsg.lw.LW_OS
  362. msgRet.uuid = human.db._id
  363. msgRet.value = temp
  364. InnerMsg.sendMsg(0, msgRet)]]
  365. end
  366. end
  367. function d3.createtime(human, value)
  368. value = value and tonumber(value)
  369. if not value then return end
  370. local now = os.time()
  371. local temp = Util.getDayStartTime(now)
  372. temp = temp - (value - 1) * 24 * 3600
  373. human.db.createTime = temp
  374. local tb = os.date("%Y%m%d", temp)
  375. Broadcast.sendErr(human, "设置当前创角时间为" .. tb)
  376. end
  377. --设置中心服开服时间
  378. function d3.osw(human, value)
  379. value = value and tonumber(value)
  380. local msgRet = InnerMsg.lw.LW_OS
  381. msgRet.uuid = human.db._id
  382. msgRet.value = value
  383. InnerMsg.sendMsg(0, msgRet)
  384. end
  385. function d3.chengjiu(human,val)
  386. local ChengjiuExcel = require("excel.chengjiu").chengjiu
  387. local ChengjiuLogic = require("chengjiu.ChengjiuLogic")
  388. for k,v in pairs(ChengjiuExcel) do
  389. ChengjiuLogic.onCallback(human,v.type, v.param)
  390. end
  391. end
  392. function d3.jjczero()
  393. local JjcLogic = require("jjc.JjcLogic")
  394. JjcLogic.onZero()
  395. end
  396. function d3.jjcreset()
  397. JjcDB.resetJJCDB()
  398. end
  399. function d3.jpSet(human,val)
  400. local point = tonumber(val)
  401. JjcDB.updatePlayerPoint(human.db._id, point, nil)
  402. end
  403. function d3.billboard(human)
  404. local BillboardDB = require("billboard.BillboardDB")
  405. BillboardDB.sort()
  406. end
  407. function d3.cldjs(human)
  408. human.db.jinbiExchange = nil
  409. end
  410. -- 激活钻石基金
  411. function d3.fund(human, val)
  412. local type = tonumber(val)
  413. local FundLogic = require("present.FundLogic")
  414. FundLogic.fundBuy(human, type)
  415. end
  416. -- 清空钻石基金购买和发放记录
  417. function d3.clfund(human)
  418. human.db.fundFlag = nil
  419. end
  420. function d3.clbuy(human)
  421. human.db.buy = {}
  422. end
  423. --增加好战者计数 仅限竞技场和试炼
  424. function d3.hzzadd(human, val)
  425. if val == nil then return end
  426. local pos = string.find(val, " ", 1, true)
  427. if pos == nil then return end
  428. local type = tonumber(string.sub(val, 1, pos - 1))
  429. local add= tonumber(string.sub(val,pos+1,#val))
  430. local MonthHzz = require("monthAct.MonthHzz")
  431. if type == MonthHzz.MONTHACT_HZZ_TYPE_1 then
  432. MonthHzz.addJjcFight(human, nil, add)
  433. elseif type == MonthHzz.MONTHACT_HZZ_TYPE_2 then
  434. MonthHzz.addTrialCnt(human, nil, add)
  435. end
  436. end
  437. function d3.ydjiuguan(human, val)
  438. if val == nil then return end
  439. local pos = string.find(val, " ", 1, true)
  440. if pos == nil then return end
  441. local star = tonumber(string.sub(val, 1, pos - 1))
  442. local add= tonumber(string.sub(val,pos+1,#val))
  443. local MonthDrunkery = require("monthAct.MonthDrunkery")
  444. MonthDrunkery.addDrunkCntEx(human, star, add)
  445. end
  446. function d3.ydhcjx(human, val)
  447. if val == nil then return end
  448. local param = Util.split(val, " ")
  449. local type = tonumber(param[1])
  450. local heroId= tonumber(param[2])
  451. local add = tonumber(param[3])
  452. local MonthHecJuex = require("monthAct.MonthHecJuex")
  453. MonthHecJuex.addCntByGm(human,type,heroId, add)
  454. end
  455. function d3.clboss(human)
  456. local DB = require("common.DB")
  457. local LuaMongo = _G.lua_mongo
  458. LuaMongo.remove(DB.db_boss)
  459. end
  460. function d3.clwish(human)
  461. human.db.wishCnt = nil
  462. human.db.wishActAlrCnt = nil
  463. end
  464. -- 设置高抽次数
  465. function d3.hsum(human,val)
  466. human.db.summonCnt = val
  467. end
  468. function d3.clhsum(human)
  469. human.db.summonCnt = nil
  470. human.db.sumWinScoCnt = nil
  471. end
  472. function d3.unionquery(human,val)
  473. local name = val
  474. local UnionLogic = require("union.UnionLogic")
  475. UnionLogic.createUnion(human,name)
  476. end
  477. function d3.uniondonate(human, value)
  478. local UnionDBLogic = require("union.UnionDBLogic")
  479. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  480. if union == nil then
  481. return
  482. end
  483. union.donate = union.donate or {}
  484. union.donate[1] = value
  485. union.donate[2] = os.time()
  486. UnionDBLogic.updateUnionData(union)
  487. end
  488. function d3.settower(human,val)
  489. local HuanjingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  490. HuanjingTowerLogic.setTowerByGm(human, val)
  491. end
  492. function d3.setbattle(human,val)
  493. local BattleLogic = require("battle.BattleLogic")
  494. local param = Util.split(val, " ")
  495. BattleLogic.setBattleByGm(human, param[1], param[2])
  496. end
  497. function d3.overmonth(human, val)
  498. val = math.max(tonumber(val) or 0, 10)
  499. human.db.actMonthEndTime = os.time() + val
  500. end
  501. function d3.zhuanpantime(human,val)
  502. local param = Util.split(val, " ")
  503. local ZhuanpanLogic = require("zhuanpan.ZhuanpanLogic")
  504. ZhuanpanLogic.zhuanpanByGm(human, tonumber(param[1]), tonumber(param[2]) )
  505. end
  506. function d3.signin(human,val)
  507. human.db.signInCnt = val
  508. for i =1,human.db.signInCnt do
  509. human.db.signIn[i] = 1
  510. end
  511. end
  512. function d3.unionLv(human, val)
  513. val = tonumber(val)
  514. if not val then return end
  515. local UnionDBLogic = require("union.UnionDBLogic")
  516. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  517. if not union then return end
  518. UnionDBLogic.upsetUnionData(union._id, "lv", val)
  519. UnionDBLogic.upsetUnionData(union._id, "exp", 0)
  520. end
  521. function d3.unionexp(human, val)
  522. val = tonumber(val)
  523. if not val then return end
  524. local UnionDBLogic = require("union.UnionDBLogic")
  525. local UnionLogic = require("union.UnionLogic")
  526. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  527. if not union then return end
  528. UnionLogic.addUnionExp(union, val)
  529. UnionDBLogic.updateUnionData(union)
  530. end
  531. function d3.gws(human,val)
  532. local LoginSignLogic = require("loginSign.LoginSignLogic")
  533. for i = 1,val do
  534. LoginSignLogic.getReward(human)
  535. end
  536. end
  537. function d3.tsht(human)
  538. local AdminLogic = require("AdminLogic")
  539. local JsonInput = {}
  540. JsonInput.accountName = human.db.account
  541. JsonInput.roleName = human.db.name
  542. AdminLogic.adminFunction.getuserstatus(JsonInput)
  543. end
  544. function d3.bs(human,val)
  545. local param = Util.split(val, " ")
  546. local AdminLogic = require("AdminLogic")
  547. local JsonInput = {}
  548. JsonInput.account = human.db.account
  549. JsonInput.minute = param[1]
  550. JsonInput.reason = param[2]
  551. AdminLogic.adminFunction.banSay(JsonInput)
  552. end
  553. function d3.bl(human,val)
  554. local AdminLogic = require("AdminLogic")
  555. local JsonInput = {}
  556. JsonInput.accountName = human.db.account
  557. JsonInput.minute = val
  558. AdminLogic.adminFunction.banAccount(JsonInput)
  559. end
  560. function d3.bl2(human,val)
  561. local AdminLogic = require("AdminLogic")
  562. local param = Util.split(val, " ")
  563. local JsonInput = {}
  564. JsonInput.accountName = param[1]
  565. JsonInput.minute = tonumber(param[2])
  566. AdminLogic.adminFunction.banAccount(JsonInput)
  567. end
  568. function d3.cbl(human,val)
  569. local param = Util.split(val, " ")
  570. local AdminLogic = require("AdminLogic")
  571. local JsonInput = {}
  572. JsonInput.accountName = param[1]
  573. JsonInput.cancelBanSay = param[2]
  574. AdminLogic.adminFunction.cancelBanAccount(JsonInput)
  575. end
  576. function d3.bip(human,val)
  577. local param = Util.split(val, " ")
  578. local AdminLogic = require("AdminLogic")
  579. local JsonInput = {}
  580. JsonInput.IP = param[1]
  581. JsonInput.banTime = param[2]
  582. AdminLogic.adminFunction.banIp(JsonInput)
  583. end
  584. function d3.ursc(human)
  585. human.db.ectypeCnt = nil
  586. human.db.ectypeFreeTime = nil
  587. end
  588. function d3.sue(human,val)
  589. local newLevel = tonumber(val)
  590. if not newLevel then return end
  591. local UnionDBLogic = require("union.UnionDBLogic")
  592. local union = UnionDBLogic.getUnion(human.db.unionUuid)
  593. if not union then return end
  594. UnionDBLogic.updateBossLv(union,newLevel)
  595. end
  596. function d3.smtp(human,val)
  597. local param = Util.split(val, " ")
  598. local AdminLogic = require("AdminLogic")
  599. local JsonInput = {}
  600. JsonInput.recvType = 3
  601. JsonInput.title = param[1]
  602. JsonInput.content = param[2]
  603. JsonInput.fbAccount = param[3]
  604. JsonInput.senderName = "系统邮件"
  605. JsonInput.fbTime = os.time()
  606. JsonInput.fbContent = "反馈"
  607. JsonInput.startLv =0
  608. JsonInput.endLv = 51
  609. JsonInput.lastLoginTime = os.time() - 60*60
  610. AdminLogic.adminFunction.mail(JsonInput)
  611. end
  612. function d3.clmilltime(human)
  613. human.db.unionTaskGetTime = nil
  614. end
  615. function d3.tstx(human,val)
  616. local RoleHeadLogic = require("role.RoleHeadLogic")
  617. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_1, val)
  618. end
  619. function d3.tstxk(human,val)
  620. local RoleHeadLogic = require("role.RoleHeadLogic")
  621. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_2, val)
  622. end
  623. function d3.buy(human,val)
  624. local AdminLogic = require("AdminLogic")
  625. local PlatformHandler = require("platform.Handler")
  626. local ApiLogic = require("platform.ApiLogic")
  627. local BuyExcel = require("excel.buy")
  628. local buyConf = BuyExcel.buy[val]
  629. if not buyConf then return end
  630. local shopConf = BuyExcel.topup[val]
  631. if shopConf and shopConf.buyID == val then
  632. else
  633. shopConf = nil
  634. end
  635. local checkMoney = buyConf["CN"]
  636. local msg = {}
  637. msg.logintype = 2
  638. msg.openid = "oCD-L5RxAtfRe8-aiezdY-Ccla5U"
  639. msg.openkey = "VsBJf2DKah7QhzU5xuzLNA=="
  640. msg.yuanbao = shopConf and shopConf.cnt or buyConf.CN * 10
  641. msg.buyID = val
  642. msg.account = human.db.account
  643. msg.transaction_id = "transaction_id1"
  644. msg.pf = "android"
  645. msg.money = checkMoney
  646. ApiLogic.CHARGE_CODE_HIS = {}
  647. print("cccc:",val)
  648. BuyLogic.buy(human,val)
  649. --PlatformHandler.CG_TENCENT_BUY(human,msg)
  650. --AdminLogic.adminFunction.tencentPay(msg)
  651. end
  652. function d3.gol(human)
  653. local AdminLogic = require("AdminLogic")
  654. AdminLogic.adminFunction.getonlinelist()
  655. end
  656. function d3.htm(human,val)
  657. local AdminLogic = require("AdminLogic")
  658. local oJsonInput = {}
  659. oJsonInput.recvType = val -- 邮件类型
  660. oJsonInput.title = "111" -- 邮件标题
  661. oJsonInput.content = "222" -- 邮件内容
  662. oJsonInput.items = nil -- 道具列表 可以为空
  663. oJsonInput.accounts = nil -- 指定玩家列表
  664. oJsonInput.startLv = 0
  665. oJsonInput.endLv = 200
  666. AdminLogic.adminFunction.mail(oJsonInput)
  667. end
  668. function d3.cluwar(human)
  669. require("union.UnionWarLogic").cleanUnionWar()
  670. local msg = InnerMsg.lw.LW_GM
  671. msg.gm = "cluwarmiddle"
  672. InnerMsg.sendMsg(0, msg)
  673. end
  674. function d3.cluniontime(human)
  675. human.db.unionJoinTime = nil
  676. end
  677. function d3.cluwarmiddle()
  678. local LuaMongo = _G.lua_mongo
  679. local DB = require("common.DB")
  680. LuaMongo.remove(DB.db_union_war)
  681. end
  682. function d3.uwarstart()
  683. -- 需要周1、3、5使用
  684. local UnionWarLogic = require("union.UnionWarLogic")
  685. UnionWarLogic.cleanUnionWar()
  686. local msg = InnerMsg.lw.LW_GM
  687. msg.gm = "cluwarmiddle"
  688. InnerMsg.sendMsg(0, msg)
  689. UnionWarLogic.onHour(0)
  690. UnionWarLogic.onHour(1)
  691. local msg = InnerMsg.lw.LW_GM
  692. msg.gm = "uwarstartmiddle"
  693. InnerMsg.sendMsg(0, msg)
  694. end
  695. function d3.warMaxtest(human, value)
  696. require("union.UnionWarLogic").auto(value)
  697. end
  698. function d3.uwar(human,state)
  699. local msg = InnerMsg.lw.LW_GM
  700. msg.gm = "muwar "..state
  701. InnerMsg.sendMsg(0, msg)
  702. if state == 1 then
  703. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  704. UnionWarDBLogic.onHour(0, true)
  705. end
  706. end
  707. function d3.uwarshop(human, lv)
  708. require("union.UnionWarLogic").upWarShopLv(human, tonumber(lv))
  709. end
  710. function d3.uwarBuff(human)
  711. local msg = InnerMsg.lw.LW_GM
  712. msg.gm = "muwarBuff ".. human.db.unionUuid
  713. InnerMsg.sendMsg(0, msg)
  714. end
  715. function d3.muwar(human,state)
  716. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  717. if state == 1 then
  718. UnionWarDBLogic.onHour(0, true)
  719. elseif state == 2 then
  720. UnionWarDBLogic.onHour(2, true)
  721. elseif state == 3 then
  722. UnionWarDBLogic.onHour(20, true)
  723. end
  724. end
  725. function d3.muwarBuff(human, unionUuid)
  726. local UnionWarDBLogic = require("union.UnionWarDBLogic")
  727. UnionWarDBLogic.addBuffLvByGm(unionUuid)
  728. end
  729. function d3.uwartask(human, type)
  730. local UnionWarLogic = require("union.UnionWarLogic")
  731. UnionWarLogic.chegnjiuFinishGm(human, tonumber(type))
  732. end
  733. function d3.uwarstartmiddle()
  734. -- 匹配
  735. require("union.UnionWarMiddleLogic").matchUnionStart()
  736. end
  737. function d3.cljjc(human, val)
  738. val = tonumber(val)
  739. local msgRet = InnerMsg.lw.LW_CL_JJC
  740. msgRet.type = val
  741. InnerMsg.sendMsg(0, msgRet)
  742. end
  743. function d3.cluwar(human)
  744. require("union.UnionWarLogic").cleanUnionWar()
  745. local msg = InnerMsg.lw.LW_GM
  746. msg.gm = "cluwarmiddle"
  747. InnerMsg.sendMsg(0, msg)
  748. end
  749. function d3.cluwarmiddle()
  750. local LuaMongo = _G.lua_mongo
  751. local DB = require("common.DB")
  752. LuaMongo.remove(DB.db_union_war)
  753. end
  754. function d3.uwarstart()
  755. -- 需要周1、3、5使用
  756. require("union.UnionWarLogic").onHour(0)
  757. require("union.UnionWarLogic").onHour(1)
  758. local msg = InnerMsg.lw.LW_GM
  759. msg.gm = "uwarstartmiddle"
  760. InnerMsg.sendMsg(0, msg)
  761. end
  762. function d3.uwarstartmiddle()
  763. -- 匹配
  764. require("union.UnionWarMiddleLogic").matchUnionStart()
  765. end
  766. function d3.cxh(human)
  767. d3.tgod(human)
  768. d3.lv(human,200)
  769. end
  770. function d3.drop(human,val)
  771. local BattleLogic = require("battle.BattleLogic")
  772. local param = Util.split(val, " ")
  773. local cnt = tonumber(param[1])
  774. local battleID = tonumber(param[2])
  775. BattleLogic.clacItemCntGM(human,cnt,battleID)
  776. end
  777. function d3.uif(human,val)
  778. local jsonInput = {}
  779. jsonInput.unionName = val
  780. local AdminLogic = require("AdminLogic")
  781. AdminLogic.adminFunction.unionInfo(jsonInput)
  782. end
  783. function d3.ul(human,val)
  784. local jsonInput = {}
  785. jsonInput.start = tonumber(val)
  786. local AdminLogic = require("AdminLogic")
  787. AdminLogic.adminFunction.unionList(jsonInput)
  788. end
  789. function d3.monthgaochou(human, val)
  790. local MonthSummon = require("monthAct.MonthSummon")
  791. MonthSummon.onSummon(human, tonumber(val))
  792. end
  793. function d3.jhtq(human,val)
  794. local TequanLogic = require("qqTequan.TequanLogic")
  795. local param = Util.split(val, " ")
  796. local val1 = tonumber(param[1])
  797. local val2 = tonumber(param[2])
  798. local val3 = tonumber(param[3])
  799. local val4 = tonumber(param[4])
  800. TequanLogic.activateTequan(human,val1,val2,val3,val4)
  801. end
  802. function d3.unionTecLv(human,val)
  803. local UnionTecLogic = require("union.UnionTecLogic")
  804. UnionTecLogic.lvAllUpByGm(human)
  805. end
  806. function d3.auto(human,val)
  807. local param = Util.split(val, " ")
  808. local str = param[1]
  809. local val = param[2]
  810. if not str or not val then
  811. return
  812. end
  813. for i = 1, val do
  814. require("union.UnionWarLogic").auto(str .. string.format("%02d", i))
  815. end
  816. end
  817. function d3.lvAuto(human, val)
  818. val = val + 0
  819. local lvOld = human.db.lv
  820. local lvNew = val + 0
  821. human.db.lv = lvNew
  822. end
  823. function d3.cap(human)
  824. human.db.buyCapCnt = require("hero.HeroDefine").BUY_CAP_CNT
  825. require("hero.HeroLogic").sendHeroBagCap(human)
  826. end
  827. function d3.abscharge(human)
  828. AbsBillboardLogic.charge(human,1000)
  829. end
  830. function d3.jhpt(human)
  831. if human.pf_info.pf == "qqgame" then
  832. human.db.txHall = {}
  833. elseif human.pf_info.pf == "qzone" or human.pf_info.pf == "website" then
  834. human.db.qqZone = {}
  835. end
  836. end
  837. function d3.addfuwen(human)
  838. d3.itemadd(human,"80001 10")
  839. d3.itemadd(human,"80002 10")
  840. d3.itemadd(human,"80003 10")
  841. d3.itemadd(human,"80004 10")
  842. d3.itemadd(human,"80005 10")
  843. end
  844. function d3.addSmelt(human,val)
  845. local num = tonumber(val)
  846. human.db.smeltVal = human.db.smeltVal or 0
  847. human.db.smeltVal = human.db.smeltVal + num
  848. end
  849. function d3.zdfw(human,val)
  850. local param = Util.split(val, " ")
  851. local fuwenID = tonumber(param[1])
  852. local attr1 = tonumber(param[2])
  853. local val1 = tonumber(param[3])
  854. local attr2 = tonumber(param[4])
  855. local val2 = tonumber(param[5])
  856. local skill1 = tonumber(param[6])
  857. local skill2 = tonumber(param[7])
  858. local FuwenGrid = require("fuwen.FuwenGrid")
  859. local FuwenExcel = require("excel.fuwen").skill
  860. if (skill1 ~= nil and FuwenExcel[skill1] == nil) or (skill2 ~= nil and FuwenExcel[skill2] == nil) then
  861. print("fuck! add fuwen skill is notreal")
  862. return
  863. end
  864. FuwenGrid.setFuwenSkillAttrByGM(human,fuwenID,attr1,val1,attr2,val2,skill1,skill2)
  865. end
  866. function d3.t2(human)
  867. local input = [[{"method":"OnTokenReturnForBuy","tencent_ret":{"ret":0,"token":"fC283BD0141D50418B68200972FBEE6A13102","url_params":"\/v1\/r\/1110099166\/mobile_goods_info?token_id=BC283BD0141D50418B68200972FBEE6A13102&transaction_id=BC283BD0141D50418B68200972FBEE6A13102&out_trade_no=&new_cpay=1&offer_type=0","transaction_id":"BC283BD0141D50418B68200972FBEE6A13102","attach":""},"callback_general_param":{"name":"0-15D9C743A68D57FF8B22CC944BAEAD8C","account":"0-a"}}]]
  868. local ret = require("AdminLogic").handleAdminRequest(_, input)
  869. print(ret)
  870. end
  871. function d3.t1(human)
  872. local input = {}
  873. input.token = "fC283BD0141D50418B68200972FBEE6A13102"
  874. input.payitem = "39*60*1"
  875. input.billno = os.time()
  876. local ret = require("platform.QQApi").onDeliverReturnForBuy(input)
  877. print(ret.ret,ret.msg)
  878. end
  879. function d3.skin(human,val)
  880. local tb = Util.split(val, " ")
  881. local id = tonumber(tb[1])
  882. local cnt = tonumber(tb[2])
  883. print(id,tb[1],tb[2])
  884. if not id then
  885. human.db.skinBag = {[0] = 999}
  886. return
  887. end
  888. local SkinLogic = require("skin.SkinLogic")
  889. SkinLogic.addSkin(human,id,cnt)
  890. end
  891. function d3.ff(human,val)
  892. local FriendLogic = require("friend.FriendLogic")
  893. FriendLogic.addFriend(human, val)
  894. end
  895. function d3.chenghao(human,val)
  896. val = tonumber(val)
  897. if not val then
  898. return
  899. end
  900. local RoleHeadLogic = require("role.RoleHeadLogic")
  901. RoleHeadLogic.active(human, RoleHeadLogic.HEAD_TYPE_4, val)
  902. end
  903. function d3.unionBillboard(human,val)
  904. val = tonumber(val)
  905. if not val then
  906. return
  907. end
  908. local BRoleLogic = require("billboard.BRoleLogic")
  909. BRoleLogic.queryUnionBillboard(human,val)
  910. end
  911. function d3.herotest(human, val)
  912. local tb = Util.split(val, " ")
  913. local combatType = 1
  914. local HeroExcel = require("excel.hero")
  915. local HeroLogic = require("hero.HeroLogic")
  916. local flags = {}
  917. human.db.combatHero = human.db.combatHero or {}
  918. human.db.combatHero[combatType] = {}
  919. for pos = 1, 6 do
  920. local id = tonumber(tb[pos])
  921. local index = nil
  922. if id and HeroExcel.hero[id] then
  923. for i = 1, human.db.heroBag[0] do
  924. local heroGrid = human.db.heroBag[i]
  925. if heroGrid and (heroGrid.id == id) and
  926. (not flags[i]) then
  927. flags[i] = true
  928. index = i
  929. break
  930. end
  931. end
  932. if not index then
  933. index = HeroLogic.getEmptyIndex(human)
  934. d3.heroadd(human, id .. " 1")
  935. end
  936. end
  937. human.db.combatHero[combatType][pos] = index
  938. end
  939. local CombatHandler = require("combat.Handler")
  940. CombatHandler.CG_COMBAT_BEGIN(human,{type = combatType, param = ""})
  941. end
  942. function d3.combat(human, monsterOutID)
  943. local CombatLogic = require("combat.CombatLogic")
  944. local param = {}
  945. param.defender, _, param.defRBase, param.defFormation = CombatLogic.getMonsterObjList(monsterOutID)
  946. require("combat.CombatLogic").combatBegin(human, 1001, param, 1)
  947. end
  948. function d3.combat2(human,id)
  949. local id = tonumber(id)
  950. local combatConf = require("excel.combat").gm[id]
  951. if not combatConf then
  952. assert()
  953. end
  954. local HeroGrid = require("hero.HeroGrid")
  955. local HeroLogic = require("hero.HeroLogic")
  956. local CombatLogic = require("combat.CombatLogic")
  957. local fakeman1 = {}
  958. local account1 = "combatFakeman1"
  959. local fakeman2 = {}
  960. local account2 = "combatFakeman2"
  961. local RoleDBLogic = require("role.RoleDBLogic")
  962. local fakemanDB1 = RoleDBLogic.getDbByAccount(account1)
  963. if not fakemanDB1 then
  964. fakemanDB1 = RoleDBLogic.createDefaultRole(account1)
  965. end
  966. fakeman1.db = fakemanDB1
  967. local fakemanDB2 = RoleDBLogic.getDbByAccount(account2)
  968. if not fakemanDB2 then
  969. fakemanDB2 = RoleDBLogic.createDefaultRole(account2)
  970. end
  971. fakeman2.db = fakemanDB2
  972. local attacker = {}
  973. local defender = {}
  974. for i = 1, fakeman1.db.heroBag[0] do
  975. HeroLogic.delHeroByIndex(fakeman1, i, "gm")
  976. end
  977. for i = 1, fakeman2.db.heroBag[0] do
  978. HeroLogic.delHeroByIndex(fakeman2, i, "gm")
  979. end
  980. for k,v in ipairs(combatConf.atk) do
  981. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  982. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  983. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  984. local heroIndex = HeroLogic.addHeroByGrid(fakeman1, heroGrid, "gm")
  985. attacker[v[2]] = CombatLogic.createHumanObj(fakeman1, heroGrid.uuid)
  986. end
  987. for k,v in ipairs(combatConf.def) do
  988. local heroGrid = HeroGrid.createHeroGrid(v[1], v[4])
  989. heroGrid.lv = math.max(heroGrid.lv, v[3] or 0)
  990. heroGrid.quality = HeroGrid.getMaxQuality(heroGrid.star)
  991. local heroIndex = HeroLogic.addHeroByGrid(fakeman2, heroGrid, "gm")
  992. defender[v[2]] = CombatLogic.createHumanObj(fakeman2, heroGrid.uuid)
  993. end
  994. local atkPet = nil
  995. local defPet = nil
  996. CombatLogic.combatGm(human,1001,combatConf.atkF, attacker,combatConf.defF,defender,atkPet,defPet,{{101,1},{102,2},{103,3},{104,4}})
  997. end
  998. function d3.combatEnd(human)
  999. local CombatLogic = require("combat.CombatLogic")
  1000. for i = CombatDefine.COMBAT_TYPE1, CombatDefine.COMBAT_TYPE_MAX do
  1001. CombatLogic.clientFinish(human, i)
  1002. end
  1003. end
  1004. -- it道具添加(支持中文)
  1005. function d3.it(human,value)
  1006. local tb = Util.split(value," ")
  1007. local id = tonumber(tb[1])
  1008. local cnt = tonumber(tb[2])
  1009. if id == nil then id = tb[1] end
  1010. if type(id) == "string" then
  1011. id = ItemDefine.getIdByName(id)
  1012. end
  1013. if type(id) ~= "number" then
  1014. print("err id", tb[1], id, type(id))
  1015. return
  1016. end
  1017. cnt = cnt or 1000
  1018. BagLogic.addItem(human, id, cnt, "gm")
  1019. end
  1020. -- 清除酒馆
  1021. function d3.clbartask(human)
  1022. human.db.bar = nil
  1023. end
  1024. function d3.updaily(human)
  1025. ObjHuman.updateDaily(human, true)
  1026. end
  1027. function d3.clguide(human)
  1028. human.db.noguide = nil
  1029. human.db.guide = nil
  1030. human.guideLoginStep = nil
  1031. require("guide.GuideLogic").refreshGuide(human)
  1032. require("guide.GuideLogic").sendStep(human)
  1033. end
  1034. function d3.nextguide(human)
  1035. local GuideExcel = require("excel.guide")
  1036. local GuideLogic = require("guide.GuideLogic")
  1037. local id = GuideLogic.getGuideID(human)
  1038. local nextstep = GuideLogic.getGuideStep(human) + 1
  1039. local cf = id and GuideExcel.main_guide[id]
  1040. local sid = cf and cf.guideList[nextstep]
  1041. GuideLogic.stepFinish(human, sid)
  1042. end
  1043. function d3.guide(human, id)
  1044. human.db.noguide = nil
  1045. human.guideLoginStep = nil
  1046. local GuideLogic = require("guide.GuideLogic")
  1047. GuideLogic.setGuide(human, id, GuideLogic.STATE_DOING)
  1048. GuideLogic.sendStep(human)
  1049. end
  1050. -- 跳过指引
  1051. function d3.noguide(human)
  1052. human.db.noguide = true
  1053. human.guideLoginStep = nil
  1054. require("guide.GuideLogic").sendStep(human, true)
  1055. end
  1056. function d3.creatunion(human,value)
  1057. d3.lv(human,30)
  1058. d3.viplv(human,2)
  1059. d3.zuanshi(human, 1000)
  1060. local UnionLogic = require("union.UnionLogic")
  1061. UnionLogic.createUnion(human, value)
  1062. end
  1063. function d3.cldraw(human, value)
  1064. human.db.drawCard = {jifen=tonumber(value),list={[1]={},[2]={},[3]={},[4]={}}}
  1065. end
  1066. function d3.cldrill(human)
  1067. require("drill.DrillDB").reset()
  1068. end
  1069. function d3.zhengdian(_, hour)
  1070. hour = tonumber(hour) or 0
  1071. require("core.Timer").doZhengDian(hour)
  1072. end
  1073. function d3.tgod(human)
  1074. local HeroLogic = require("hero.HeroLogic")
  1075. local HeroGrid = require("hero.HeroGrid")
  1076. local HeroExcel = require("excel.hero")
  1077. for heroID, config in pairs(HeroExcel.tujian) do
  1078. local heroConfig = HeroExcel.hero[heroID]
  1079. if heroConfig then
  1080. local star = heroConfig.star
  1081. local maxQuality = HeroGrid.getMaxQuality(star)
  1082. local maxLv = HeroGrid.getMaxLv(star,maxQuality)
  1083. d3.heroadd(human, heroID .. " 1".." "..maxLv.." "..maxQuality)
  1084. end
  1085. end
  1086. end
  1087. function d3.tujian(human, camp)
  1088. local HeroExcel = require("excel.hero")
  1089. camp = tonumber(camp)
  1090. for heroID, config in pairs(HeroExcel.tujian) do
  1091. if config.camp == camp or not camp then
  1092. d3.heroadd(human, heroID .. " 1")
  1093. end
  1094. end
  1095. end
  1096. function d3.cljingcailibao(human)
  1097. human.db.dailyLeiChong = nil
  1098. human.db.leichongHaoli = nil
  1099. human.db.topupAcountDaily = nil
  1100. human.db.topupAccountMonth = nil
  1101. end
  1102. function d3.qijifen(human,value)
  1103. human.db.sevenDayGoal = human.db.sevenDayGoal or {}
  1104. human.db.sevenDayGoal[9] = human.db.sevenDayGoal[8] or {}
  1105. human.db.sevenDayGoal[9].jifen = value
  1106. end
  1107. function d3.clqirimubiao(human)
  1108. human.db.sevenDayGoal = nil
  1109. end
  1110. function d3.throne(human, str)
  1111. if str == nil then return end
  1112. local tb = Util.split(str, " ")
  1113. local id = tonumber(tb[1])
  1114. local lv = tonumber(tb[2])
  1115. if not id or not lv then return end
  1116. local TheStarsDBLogic = require("theStars.TheStarsDBLogic")
  1117. local list = TheStarsDBLogic.getThroneList()
  1118. local throne = list[id]
  1119. if not throne then return end
  1120. throne.lv = lv
  1121. TheStarsDBLogic.updateThroneDB(throne)
  1122. end
  1123. function d3.cltsts(human)
  1124. human.db.throneTime = human.db.throneTime - 14400
  1125. end
  1126. -- 删号
  1127. function d3.delaccount(human, account)
  1128. if not account then return end
  1129. local target = ObjHuman.onlineAccount[account]
  1130. if target then
  1131. return Broadcast.sendErr(human, "can't delete online")
  1132. end
  1133. local RoleDBLogic = require("role.RoleDBLogic")
  1134. if not RoleDBLogic.getDbByAccount(account) then
  1135. return Broadcast.sendErr(human, "account not exist")
  1136. end
  1137. local LuaMongo = _G.lua_mongo
  1138. local DB = require("common.DB")
  1139. local query = {}
  1140. query.account = tostring(account)
  1141. LuaMongo.remove(DB.db_char, query)
  1142. require("core.RoleDel").roleDel()
  1143. Broadcast.sendErr(human, "delete ok, account = " .. account)
  1144. end
  1145. -- 临时开指引
  1146. function d3.openguide()
  1147. require("Config").HAS_GUIDE = true
  1148. end
  1149. function d3.closeguide()
  1150. require("Config").HAS_GUIDE = false
  1151. end
  1152. -- 自动上阵
  1153. function d3.autoteam(human, combatType)
  1154. if tonumber(combatType) == nil then return end
  1155. local CombatPosLogic = require("combat.CombatPosLogic")
  1156. local str = ""
  1157. for i = 1, 6 do
  1158. if not human.db.heroBag[i] then
  1159. local heroID = require("hero.HeroDefine").getRandHeroByIsElite()
  1160. local lv = math.random(50, 100)
  1161. d3.heroadd(human, heroID .. " 1 " .. lv)
  1162. end
  1163. str = str .. i
  1164. if i % 6 == 0 then str = str .. ","
  1165. else str = str .. "|" end
  1166. end
  1167. CombatPosLogic.updatePos(human,combatType,str)
  1168. end
  1169. function d3.fcmstate(human, state)
  1170. human.fcmState = state
  1171. require("fcm.FcmLogic").checkFcm(human)
  1172. end
  1173. function d3.oltimeday(human, time)
  1174. time = tonumber(time)
  1175. if not time then return end
  1176. human.db.onlineTimeDay = time
  1177. require("fcm.FcmLogic").checkFcm(human)
  1178. end
  1179. function d3.dis(human, code)
  1180. ObjHuman.doDisconnect(human, code)
  1181. end
  1182. function d3.project(human)
  1183. local Lang = require("common.Lang")
  1184. Broadcast.sendErr(human, Lang.TEST_MULTY_PROJECT)
  1185. end
  1186. function d3.clextrabattle(human)
  1187. human.db.battleExtraReward = nil
  1188. end
  1189. function d3.clsharepf(human)
  1190. human.db.plShare = nil
  1191. end
  1192. function d3.clshareboard()
  1193. require("present.SharePlatformLogic").resetBoard()
  1194. end
  1195. function d3.sharepfall(human, cnt)
  1196. cnt = tonumber(cnt) or 15
  1197. for i = 1, cnt do
  1198. require("present.SharePlatformLogic").onShareOk(human.db.account, "account" .. i, true)
  1199. end
  1200. end
  1201. function d3.sharepf(human, accountB)
  1202. require("present.SharePlatformLogic").onShareOk(human.db.account, accountB)
  1203. end
  1204. function d3.sharepf2(human, accountA)
  1205. require("present.SharePlatformLogic").onShareOk(accountA, human.db.account)
  1206. end
  1207. function d3.sharegroup(human)
  1208. require("present.SharePlatformLogic").groupShareOK(human)
  1209. end
  1210. function d3.shareinvate(human)
  1211. require("present.SharePlatformLogic").shareInvate(human)
  1212. end
  1213. function d3.cltuisonglibao(human)
  1214. human.db.tuiSongLiBao = nil
  1215. end
  1216. function d3.clmoshou(human)
  1217. human.db.moshou = nil
  1218. end
  1219. function d3.moshoulv(human,lv)
  1220. local MoShouExcel = require("excel.moshou")
  1221. if not lv or lv <= 0 or lv > #MoShouExcel.moshouLv then return end
  1222. local MoshouLogic = require("moshou.MoshouLogic")
  1223. local isAllActive = MoshouLogic.isAllMoshouActive(human)
  1224. if not isAllActive then
  1225. local MoShouExcel = require("excel.moshou")
  1226. local config = MoShouExcel.moshouActive
  1227. for i=1,#config do
  1228. local activeTask = config[i].activeTask
  1229. for j=1,#activeTask do
  1230. human.db.moshou = human.db.moshou or {}
  1231. human.db.moshou[i] = human.db.moshou[i] or {}
  1232. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1233. human.db.moshou[i].taskGet[j] = j
  1234. end
  1235. end
  1236. end
  1237. human.db.moshou.lv = lv
  1238. human.db.moshou.lvExp = MoShouExcel.moshouLv[lv].needJinDu
  1239. human.db.moshou.skillLV = human.db.moshou.skillLV or 1
  1240. MoshouLogic.calMoshouHero(human)
  1241. end
  1242. function d3.activemoshou(human,moshouID)
  1243. if not moshouID or moshouID <= 0 then return end
  1244. local MoShouExcel = require("excel.moshou")
  1245. local config = MoShouExcel.moshouActive
  1246. for i=1,moshouID do
  1247. local activeTask = config[i].activeTask
  1248. for j=1,#activeTask do
  1249. human.db.moshou = human.db.moshou or {}
  1250. human.db.moshou[i] = human.db.moshou[i] or {}
  1251. human.db.moshou[i].taskGet = human.db.moshou[i].taskGet or {}
  1252. human.db.moshou[i].taskGet[j] = j
  1253. end
  1254. end
  1255. if moshouID == #config then
  1256. d3.moshoulv(human,1)
  1257. end
  1258. local MoshouLogic = require("moshou.MoshouLogic")
  1259. MoshouLogic.calMoshouHero(human)
  1260. end
  1261. function d3.moshouupneed(human)
  1262. local MoShouExcel = require("excel.moshou")
  1263. local lvUpNeed1 = MoShouExcel.moshouLv[2].lvUpNeed[1][1]
  1264. local lvUpNeed2 = MoShouExcel.moshouLv[2].lvUpNeed[2][1]
  1265. d3.it(human,lvUpNeed1)
  1266. d3.it(human,lvUpNeed2)
  1267. local jingLianUp1 = MoShouExcel.moshouJingLian[2].lvUpNeed[1][1]
  1268. local jingLianUp2 = MoShouExcel.moshouJingLian[2].lvUpNeed[2][1]
  1269. d3.it(human,jingLianUp1)
  1270. d3.it(human,jingLianUp2)
  1271. local zhuhunUp = MoShouExcel.moshouZhuHun[1].costID
  1272. d3.it(human,zhuhunUp)
  1273. local skillup1 = MoShouExcel.moshouSkillLv[2].upCost[1][1]
  1274. local skillup2 = MoShouExcel.moshouSkillLv[2].upCost[2][1]
  1275. d3.it(human,skillup1)
  1276. d3.it(human,skillup2)
  1277. end
  1278. function d3.moshoujinglian(human,val)
  1279. if not human.db.moshou then return end
  1280. human.db.moshou.jingLian = val
  1281. end
  1282. function d3.clolinereward(human)
  1283. require("onlineReward.OnlineRewardLogic").initDB(human)
  1284. end
  1285. function d3.clonlinerewardget(human)
  1286. human.db.onlineReward.getId = 0
  1287. end
  1288. function d3.bartaskfinish(human)
  1289. local BarTaskLogic = require("bar.BarTaskLogic")
  1290. BarTaskLogic.initDB(human)
  1291. for taskID, taskData in pairs(human.db.bar) do
  1292. if type(taskID) == "number" then
  1293. human.db.bar[taskID].ts = 0
  1294. end
  1295. end
  1296. end
  1297. function d3.test(human)
  1298. local str = Util.format("aa{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}{16}",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
  1299. Broadcast.sendErr(human, str)
  1300. print(str)
  1301. end
  1302. function d3.clbattle()
  1303. local DB = require("common.DB")
  1304. local LuaMongo = _G.lua_mongo
  1305. LuaMongo.remove(DB.db_battle_shark)
  1306. end
  1307. -- 设置天梯争霸状态
  1308. function d3.jjcladderstart()
  1309. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1310. local JjcLadderExcel = require("excel.jjcLadder")
  1311. local JjcLadderDefine = JjcLadderExcel.define[1]
  1312. JjcLadderLogic.onActReady()
  1313. local week = Util.getWeekDay(os.time()) - 1
  1314. if week == 0 then
  1315. week = 7
  1316. end
  1317. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1318. JjcLadderDefine.startTime.week = week
  1319. JjcLadderDefine.endTime.week = week + 1
  1320. JjcLadderLogic.onTimer()
  1321. local msg = InnerMsg.lw.LW_GM
  1322. msg.gm = "jjcladderstartmiddle"
  1323. InnerMsg.sendMsg(0, msg)
  1324. end
  1325. function d3.jjcladderstartmiddle()
  1326. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1327. local JjcLadderExcel = require("excel.jjcLadder")
  1328. local JjcLadderDefine = JjcLadderExcel.define[1]
  1329. JjcLadderLogic.onActReady()
  1330. local week = Util.getWeekDay(os.time()) - 1
  1331. if week == 0 then
  1332. week = 7
  1333. end
  1334. JjcLadderLogic.TEMP_TIMER_STAMPTIME = nil
  1335. JjcLadderDefine.startTime.week = week
  1336. JjcLadderDefine.endTime.week = week + 1
  1337. JjcLadderLogic.onTimer()
  1338. end
  1339. -- 天梯争霸报错
  1340. function d3.jjcladdersign(human)
  1341. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1342. if JjcLadderLogic.getState() == JjcLadderLogic.STATE_ACT_START then
  1343. local commonDB = JjcLadderLogic.getCommonDB()
  1344. commonDB.uuid2sign = commonDB.uuid2sign or {}
  1345. commonDB.uuid2sign[human.db._id] = os.time()
  1346. JjcLadderLogic.saveCommonDB(commonDB)
  1347. JjcLadderLogic.onUpdatePos(human)
  1348. end
  1349. end
  1350. -- 天梯争霸结束回调
  1351. function d3.jjcladderend()
  1352. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1353. JjcLadderLogic.onActEnd()
  1354. local msg = InnerMsg.lw.LW_GM
  1355. msg.gm = "jjcladderendmiddle"
  1356. InnerMsg.sendMsg(0, msg)
  1357. end
  1358. function d3.jjcladderendmiddle()
  1359. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1360. JjcLadderLogic.onActEnd()
  1361. end
  1362. -- 重置天梯争霸活动信息
  1363. function d3.cljjcladder()
  1364. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1365. JjcLadderLogic.saveCommonDB()
  1366. JjcLadderLogic.onActEnd()
  1367. local msg = InnerMsg.lw.LW_GM
  1368. msg.gm = "cljjcladdermiddle"
  1369. InnerMsg.sendMsg(0, msg)
  1370. end
  1371. function d3.cljjcladdermiddle()
  1372. local JjcLadderLogic = require("jjcLadder.JjcLadderLogic")
  1373. JjcLadderLogic.saveCommonDB()
  1374. JjcLadderLogic.onActEnd()
  1375. end
  1376. function d3.clcombat(human,val)
  1377. human.db.combatHero[val] = nil
  1378. end
  1379. function d3.clshop(human,val)
  1380. human.db.shop[val] = nil
  1381. end
  1382. -- 重置日常礼包
  1383. function d3.clrichanglibao(human)
  1384. human.db.richangLibao = nil
  1385. end
  1386. -- 重置荣耀峡谷(龙族战场)
  1387. function d3.clvalley()
  1388. local ValleyLogic = require("valley.ValleyLogic")
  1389. ValleyLogic.cleanDB()
  1390. local msg = InnerMsg.lw.LW_GM
  1391. msg.gm = "clvalleymiddle"
  1392. InnerMsg.sendMsg(0, msg)
  1393. end
  1394. function d3.clvalleymiddle()
  1395. local ValleyLogic = require("valley.ValleyLogic")
  1396. ValleyLogic.cleanDB()
  1397. end
  1398. -- 重置荣耀峡谷(龙族战场)成就
  1399. function d3.clvalleytask(human)
  1400. human.db.valleyTask = nil
  1401. end
  1402. -- 增加荣耀峡谷(龙族战场)个人成就值
  1403. function d3.valleytask1(human, value)
  1404. require("valley.ValleyTask").updateValue(human.db._id, value, 0)
  1405. end
  1406. -- 增加荣耀峡谷(龙族战场)团队成就值
  1407. function d3.valleytask2(human, value)
  1408. require("valley.ValleyTask").updateValue(human.db._id, 0, value)
  1409. end
  1410. function d3.touchLv(human,val)
  1411. local liveness = val + 0
  1412. require("union.UnionLivenessLogic").touchLv(human, liveness)
  1413. end
  1414. function d3.clyj()
  1415. local DB = require("common.DB")
  1416. local LuaMongo = _G.lua_mongo
  1417. LuaMongo.remove(DB.db_yjTreasure)
  1418. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1419. YjTreasureDBLogic.YJ_TREASURE_DB = {}
  1420. end
  1421. function d3.yjlayer(human,val)
  1422. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1423. local YjTreasureDBLogic = require("yjTreasure.YjTreasureDB")
  1424. local YjTreasureExcel = require("excel.yjTreasure")
  1425. local Lang = require("common.Lang")
  1426. local layerData = YjTreasureDBLogic.getLayerDataByUuid(human.db._id)
  1427. local layCnf = YjTreasureExcel.layer
  1428. local nowLayer = layerData.layer
  1429. if val > #layCnf then return Broadcast.sendErr(human,Lang.YJTREASURE_LAYER_ERR) end
  1430. local roleData = YjTreasureDBLogic.getRoleDataByUuid(human.db._id)
  1431. local layerMax = roleData.layerMax or 0
  1432. if layerMax < val then
  1433. roleData.layerMax = val
  1434. YjTreasureDBLogic.updateRoleDataByUuid(roleData,human.db._id)
  1435. end
  1436. YjTreasureDBLogic.creatLayerDataByUuid(human.db._id,val)
  1437. YjTreasureLogic.CG_YJTREASURE_QUERY(human)
  1438. end
  1439. function d3.towerKing(human)
  1440. local HuanJingTowerLogic = require("huanjingTower.HuanjingTowerLogic")
  1441. HuanJingTowerLogic.unlockTowerKing(human)
  1442. end
  1443. -- 设置炼狱最大通关层
  1444. function d3.lianyu(human, value)
  1445. value = tonumber(value)
  1446. if not value then return end
  1447. if value < 0 then return end
  1448. local LianyuExcel = require("excel.lianyu")
  1449. if value > 0 and not LianyuExcel.gamelevel[value] then
  1450. return
  1451. end
  1452. LianyuLogic = require("lianyu.LianyuLogic")
  1453. LianyuLogic.setMaxLv(human, value)
  1454. end
  1455. function d3.cllianyu(human)
  1456. human.db.lianyu = nil
  1457. end
  1458. function d3.cllianyuhelp()
  1459. local CommonDB = require("common.CommonDB")
  1460. CommonDB.updateValue(CommonDB.KEY_LIANYU, nil)
  1461. end
  1462. -- 清除特权商店相关信息
  1463. function cltequanshop(human)
  1464. human.db.tequanShop = nil
  1465. human.db.tequanMopup = nil
  1466. if human.db.bar then
  1467. human.db.bar.vip = nil
  1468. human.db.bar.surVip = nil
  1469. end
  1470. end
  1471. function d3.addbts(human)
  1472. local now = os.time()
  1473. require("battle.BattleLogic").initBattleOut(human, now)
  1474. human.db.battleOut.expTs1 = now - 7200
  1475. human.db.battleOut.itemTs1 = now - 7200
  1476. human.db.battleOut.expTs2 = now - 7200
  1477. human.db.battleOut.itemTs2 = now - 7200
  1478. end
  1479. function d3.addbsd(human)
  1480. human.db.mopupDoCnt = 0
  1481. human.db.mopupFreeCnt = 0
  1482. end
  1483. function d3.addYjYj(human,type)
  1484. local YjTreasureLogic = require("yjTreasure.YjTreasureLogic")
  1485. YjTreasureLogic.yjYaoJiAdd(human,10,type)
  1486. end
  1487. function d3.ajfc(human,val)
  1488. for i = 1,val do
  1489. human.db.jjcDailyFight = (human.db.jjcDailyFight or 0) + 1
  1490. require("jjc.JjcDB").updateTotalFight(human.db._id)
  1491. end
  1492. end
  1493. function d3.godWartest(human)
  1494. local JjcGodWarLogic = require("jjcGodWar.JjcGodWarLogic")
  1495. JjcGodWarLogic.jjcGodWarFinishGm(human)
  1496. end
  1497. function d3.closeMiddle(human)
  1498. MiddleConnect.stopConnectMiddle()
  1499. end
  1500. function d3.resetMiddle(human)
  1501. MiddleConnect.autoResetMiddle()
  1502. end
  1503. function d3.loginSign(human, value)
  1504. value = tonumber(value)
  1505. local LoginSignLogic = require("loginSign.LoginSignLogic")
  1506. LoginSignLogic.updateGM(human, value)
  1507. end
  1508. function d3.yuanjun(human, value)
  1509. human.db.combatBackup = 1
  1510. end
  1511. function d3.buyItem(human, value)
  1512. require("shop.ShopLogic").buy(human, 9, 405007, 1, 1)
  1513. end
  1514. function d3.testTimeDelay(human,delay)
  1515. delay = assert(tonumber(delay),"invalid param")
  1516. Timer.addLater(delay,function(param)
  1517. print("=======================",param)
  1518. end,"hello world")
  1519. end
  1520. function d3.test2(human,value)
  1521. print("excute gm command test2")
  1522. local buyId = tonumber(value)
  1523. BuyLogic.buy(human,{
  1524. buyID = buyId,
  1525. order = "testetstest112",
  1526. price = 10,
  1527. account = "test322"
  1528. })
  1529. end
  1530. function d3.test1(human)
  1531. --require("absAct.MangHeLogic").draw(human, 1)
  1532. local oJsonInput = {
  1533. type=1,
  1534. id=payParams.id,--商品id
  1535. cnt=payParams.cnt, --数量
  1536. money=payParams.money, -- 金额
  1537. account=payParams.account, --账号
  1538. order=payParams.order,--订单号
  1539. region="cn",
  1540. }
  1541. local buyRet = ApiLogic.deliver(oJsonInput,{})
  1542. --[[BuyLogic.buy(human,{
  1543. buyID = 91001,
  1544. price = 6,
  1545. money = 6
  1546. })]]
  1547. end
  1548. function d3.zbsj(human,val)
  1549. if human.db.zhanbu == nil then
  1550. return
  1551. end
  1552. human.db.zhanbu.money = val
  1553. end
  1554. function d3.tjm(human)
  1555. require("present.RelationGiftLogic").relationBind(human, "017772140001")
  1556. end
  1557. function d3.qcjz(human)
  1558. human.db.unionDonate = nil
  1559. end
  1560. function d3.unionCopyLv(human, val)
  1561. require("union.UnionEctypeLogic").toUnionBossLvGm(human, tonumber(val))
  1562. end
  1563. function d3.fff(human)
  1564. human.db.leaveUnionLimit = nil
  1565. end
  1566. function d3.hgw(args)
  1567. require("absAct.HeroGrowUp").actLoop()
  1568. end
  1569. function d3.hgwlv(human,val)
  1570. require("absAct.HeroGrowUp").addJifen(human,tonumber(val))
  1571. end
  1572. function d3.paoma(human, val)
  1573. require("chat.ChatPaoMaLogic").notice(val)
  1574. end
  1575. -- 设置合服时间
  1576. function d3.merge(human,value)
  1577. value = value and tonumber(value)
  1578. if value == nil then
  1579. local mergeSvrTime = CommonDB.getMergeServerTime()
  1580. if mergeSvrTime == 0 then
  1581. Broadcast.sendErr(human, "未设置合服时间")
  1582. else
  1583. local tb = os.date("%Y%m%d", mergeSvrTime)
  1584. Broadcast.sendErr(human, "当前合服时间为" .. tb)
  1585. end
  1586. else
  1587. local now = os.time()
  1588. local temp = Util.getDayStartTime(now)
  1589. temp = temp - (value - 1) * 24 * 3600
  1590. CommonDB.setMergeTime(temp)
  1591. local tb = os.date("%Y%m%d", temp)
  1592. Broadcast.sendErr(human, "设置当前合服时间为" .. tb)
  1593. --同步中心服开服时间
  1594. --[[local msgRet = InnerMsg.lw.LW_OS
  1595. msgRet.uuid = human.db._id
  1596. msgRet.value = temp
  1597. InnerMsg.sendMsg(0, msgRet)]]
  1598. end
  1599. end
  1600. --重置看广告获取高级召唤卷次数
  1601. function d3.resetad(human)
  1602. human.db.adRewardCnt = 0
  1603. end
  1604. --重置看广告加速孵化次数
  1605. function d3.resetadhatch(human)
  1606. human.db.adHatchRewardCnt = 0
  1607. end
  1608. -- 设置战斗界面挂机时间
  1609. function d3.guaji(human,value)
  1610. value = value and tonumber(value)
  1611. local gmFuc = require("battle.BattleLogic").gmSetHangTime
  1612. gmFuc(human, value)
  1613. end
  1614. function d3.resetweek(human)
  1615. WeekendLoopActManger.GMResetWeekAct(human)
  1616. end
  1617. function d3.savedb(human)
  1618. ObjHuman.GM_SaveDB(human)
  1619. end