Gm.lua 52 KB

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