From 8a445fc0209a334d0d5e263d6986328d965c668f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 30 五月 2025 12:22:14 +0800
Subject: [PATCH] 16 卡牌服务端(GM调试属性修改;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py | 68 +++++++++++++++++++++++-----------
1 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
index ab5ab3f..78412de 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Mail.py
@@ -32,6 +32,7 @@
GameWorld.DebugAnswer(curPlayer, "清空邮件: Mail 0")
GameWorld.DebugAnswer(curPlayer, "发送邮件: Mail 几封 物品数 [模板key 参数1 ...]")
GameWorld.DebugAnswer(curPlayer, "输出邮件: Mail p")
+ GameWorld.DebugAnswer(curPlayer, "发送全服: Mail s 物品数 [天数]")
return
value = gmList[0]
@@ -42,6 +43,10 @@
if value == "p":
PrintPlayerMail(curPlayer)
+ return
+
+ if value == "s":
+ SendServerMail(curPlayer, gmList)
return
if value > 0:
@@ -57,37 +62,56 @@
mailTypeKey = gmList[2] if len(gmList) > 2 else ""
paramList = gmList[3:]
- itemIDList = range(3501, 3530 + 1)
- moneyIDList = [20, 30]
-
mailMgr = DBDataMgr.GetMailMgr()
mailCntBef = mailMgr.GetPersonalMailCount(playerID)
-
- isBind = 0
for _ in range(sendCnt):
-
- itemList = []
- if mailItemCnt:
- for moneyID in moneyIDList:
- itemCount = random.choice([100, 1000, 10000, 20000, 50000, 100000, 200000, 300000, 500000])
- itemList.append([moneyID, itemCount, isBind])
- if len(itemList) >= mailItemCnt:
- break
-
- random.shuffle(itemIDList)
- for i in range(mailItemCnt):
- itemID = itemIDList[i]
- itemCount = random.randint(1, 100000)
- itemList.append([itemID, itemCount, isBind])
- if len(itemList) >= mailItemCnt:
- break
-
+ itemList = __randMailItem(mailItemCnt)
PlayerMail.SendMailByKey(mailTypeKey, playerID, itemList, paramList)
mailCntAft = mailMgr.GetPersonalMailCount(playerID)
GameWorld.DebugAnswer(curPlayer, "发送个人邮件OK:%s, %s~%s" % (sendCnt, mailCntBef, mailCntAft))
return
+def SendServerMail(curPlayer, gmList):
+ mailItemCnt = gmList[1] if len(gmList) > 1 else 5
+ limitDays = gmList[2] if len(gmList) > 2 else 7
+
+ randValue = random.randint(1, 1000)
+ title = GameWorld.GbkToCode("全服邮件标题%s" % randValue)
+ text = GameWorld.GbkToCode(
+ '''全服邮件内容全服邮件内容全服邮件内容全服邮件内容全服邮件内容
+ 全服邮件内容全服邮件内容全服邮件内容全服邮件内容全服邮件内容%s
+ ''' % randValue
+ )
+ itemList = __randMailItem(mailItemCnt)
+
+ PlayerMail.SendSeverMail("", title, text, itemList, limitDays)
+ GameWorld.DebugAnswer(curPlayer, "发送全服邮件OK!")
+ return
+
+def __randMailItem(mailItemCnt):
+ itemIDList = range(3501, 3530 + 1)
+ moneyIDList = [20, 30]
+
+ isBind = 0
+ itemList = []
+ if mailItemCnt:
+ for moneyID in moneyIDList:
+ itemCount = random.choice([100, 1000, 10000, 20000, 50000, 100000, 200000, 300000, 500000])
+ itemList.append([moneyID, itemCount, isBind])
+ if len(itemList) >= mailItemCnt:
+ break
+
+ random.shuffle(itemIDList)
+ for i in range(mailItemCnt):
+ itemID = itemIDList[i%len(itemIDList)]
+ itemCount = random.randint(1, 100000)
+ itemList.append([itemID, itemCount, isBind])
+ if len(itemList) >= mailItemCnt:
+ break
+
+ return itemList
+
def ClearMail(curPlayer):
notifyGUIDState = {}
playerID = curPlayer.GetPlayerID()
--
Gitblit v1.8.0