ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/Zhenbaoge.py
@@ -17,6 +17,7 @@
import ChConfig
import GameWorld
import CrossPlayer
import PlayerControl
import PlayerFamilyZhenbaoge
import PlayerFamily
@@ -24,14 +25,22 @@
import random
import time
## GM命令执行入口
#  @param curPlayer 当前玩家
#  @param msgList 参数列表 [addSkillID]
#  @return None
#  @remarks 函数详细说明.
def GetGMServerIDList(curPlayer):
    ## 获取命令额外发送到其他服务器,如跨服
    crossServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
    if crossServerID:
        GameWorld.DebugAnswer(curPlayer, "本服公会已互通跨服ID:%s" % crossServerID)
        return [crossServerID]
    GameWorld.DebugAnswer(curPlayer, "本服公会未互通")
    return []
def OnExec(curPlayer, msgList):
    
    isMainServer = GameWorld.IsMainServer()
    if not msgList:
        if not isMainServer:
            return
        GameWorld.DebugAnswer(curPlayer, "-----%s-----" % GameWorld.GetCurrentDataTimeStr())
        GameWorld.DebugAnswer(curPlayer, "重置公会珍宝阁: Zhenbaoge 0")
        GameWorld.DebugAnswer(curPlayer, "重置今日状态值: Zhenbaoge d")
        GameWorld.DebugAnswer(curPlayer, "设置退公会时间: Zhenbaoge ft x分钟前")
@@ -39,21 +48,20 @@
        GameWorld.DebugAnswer(curPlayer, "AB值没有填则按常规砍价价格计算")
        return
    
    familyID = curPlayer.GetFamilyID()
    if not familyID:
        GameWorld.DebugAnswer(curPlayer, "没有仙盟")
        return
    curFamily = DBDataMgr.GetFamilyMgr().FindFamily(familyID)
    if not curFamily:
    crossPlayer = CrossPlayer.GetCrossPlayerMgr().FindCrossPlayer(curPlayer.GetPlayerID())
    if not crossPlayer:
        return
    
    value1 = msgList[0]
    if value1 == 0:
        PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily)
        GameWorld.DebugAnswer(curPlayer, "重置仙盟珍宝阁OK")
    familyID = crossPlayer.GetFamilyID()
    if not familyID:
        GameWorld.DebugAnswer(crossPlayer, "没有仙盟")
        return
    elif value1 == "d":
    value1 = msgList[0]
    # 默认本服执行的
    if value1 == "d":
        if not isMainServer:
            return
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeCut, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyZhenbaogeBuy, 0)
        PlayerFamilyZhenbaoge.Sync_ZhenbaogeInfo(curPlayer)
@@ -61,16 +69,40 @@
        return
    
    elif value1 == "ft":
        if not isMainServer:
            return
        minutes = msgList[1] if len(msgList) > 1 else 0
        leaveFamilyTimeEx = int(time.time()) - minutes * 60
        PlayerControl.SetLeaveFamilyTimeEx(curPlayer, leaveFamilyTimeEx)
        GameWorld.DebugAnswer(curPlayer, "设置退仙盟时间:%s" % GameWorld.ChangeTimeNumToStr(leaveFamilyTimeEx))
        return
    
    if isMainServer:
        crossServerID = DBDataMgr.GetFamilyMgr().GetCurCrossServerID()
        if crossServerID:
            # 本服公会已互通不再执行本服命令
            return
    # 本服、跨服通用
    familyMgr = DBDataMgr.GetFamilyMgr()
    curFamily = familyMgr.FindFamily(familyID)
    if not curFamily:
        GameWorld.DebugAnswer(crossPlayer, "玩家未加入公会!")
        return
    if GameWorld.IsCrossServer():
        zoneID = familyMgr.GetFamilyZoneID(familyID)
        GameWorld.DebugAnswer(crossPlayer, "跨服公会ID:%s,zoneID=%s" % (familyID, zoneID))
    if value1 == 0:
        PlayerFamilyZhenbaoge.OnZhenbaogeReset(curFamily)
        GameWorld.DebugAnswer(crossPlayer, "重置仙盟珍宝阁OK")
        return
    #添加假砍价
    gActionData = PlayerFamilyZhenbaoge.GetZhenbaogeActionData(familyID, PlayerFamilyZhenbaoge.ActionGlobalID)
    if not gActionData:
        GameWorld.DebugAnswer(curPlayer, "请先重置珍宝阁")
        GameWorld.DebugAnswer(crossPlayer, "请先重置珍宝阁")
        return
    
    familyAction = DBDataMgr.GetFamilyActionMgr().GetFamilyAction(familyID, PlayerFamilyZhenbaoge.ActionType)
@@ -98,9 +130,9 @@
        actionData = PlayerFamilyZhenbaoge.AddCutPrice(familyID, playerID, playerName, cutPrice, gActionData, False)
        syncActionDataList.append(actionData)
        nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
        GameWorld.DebugAnswer(curPlayer, "砍价人次:%s,砍价:%s,现价:%s" % (fackID % 1000, cutPrice, nowPrice))
        GameWorld.DebugAnswer(crossPlayer, "砍价人次:%s,砍价:%s,现价:%s" % (fackID % 1000, cutPrice, nowPrice))
        
    PlayerFamily.SendFamilyAction(syncActionDataList)
    nowPrice = PlayerFamilyZhenbaoge.GetFAPriceFinal(gActionData)
    GameWorld.DebugAnswer(curPlayer, "添加假砍价数:%s,总砍价数:%s,当前价格:%s" % (fackCount, familyAction.Count() - 1, nowPrice))
    GameWorld.DebugAnswer(crossPlayer, "添加假砍价数:%s,总砍价数:%s,当前价格:%s" % (fackCount, familyAction.Count() - 1, nowPrice))
    return