| | |
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import PlayerCrossRealmPK
|
| | | import CrossRealmPlayer
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | |
| | | if msgList[0] == "b":
|
| | | danLV = msgList[1] if len(msgList) > 1 else 0
|
| | | pkScore = msgList[2] if len(msgList) > 2 else 0
|
| | | |
| | | billboardCfg = IpyGameDataPY.GetFuncEvalCfg("CrossRealmPKCfg", 1, [])
|
| | | danLVLimit = billboardCfg[1] if len(billboardCfg) > 1 else 0
|
| | | if danLV < danLVLimit:
|
| | | GameWorld.DebugAnswer(curPlayer, "最低上榜段位为:%s" % danLVLimit)
|
| | | return
|
| | | cWinCount = msgList[3] if len(msgList) > 3 else None
|
| | | danIpyData = IpyGameDataPY.GetIpyGameData("CrossRealmPKDan", danLV)
|
| | | if not danIpyData:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该段位:%s" % danLV)
|
| | | return
|
| | | if pkScore <= 0:
|
| | | pkScore = danIpyData.GetLVUpScore()
|
| | | |
| | | zoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
|
| | | seasonID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
|
| | | if not zoneID or not seasonID:
|
| | | GameWorld.DebugAnswer(curPlayer, "没有分区或赛季!zoneID:%s,seasonID:%s" % (zoneID, seasonID))
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLV, danLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TotalScore, pkScore)
|
| | | |
| | | # 请求查询跨服服务器
|
| | | playerInfoDict = {"accID":curPlayer.GetAccID(),
|
| | | "playerID":curPlayer.GetPlayerID(),
|
| | | "playerName":CrossRealmPlayer.GetCrossPlayerName(curPlayer),
|
| | | "playerJob":curPlayer.GetJob(),
|
| | | "face":curPlayer.GetFace(),
|
| | | "facePic":curPlayer.GetFacePic(),
|
| | | "fightPower":PlayerControl.GetFightPower(curPlayer),
|
| | | "realmLV":curPlayer.GetOfficialRank(),
|
| | | "ondayScore":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_OnDayScore),
|
| | | "pkScore":pkScore, "danLV":danLV, "cWinCount":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_CWinCount),
|
| | | }
|
| | | dataMsg = {"ZoneID":zoneID, "SeasonID":seasonID, "GMSetCrossPK":1, "PlayerInfo":playerInfoDict}
|
| | | GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_PKBillboard, dataMsg)
|
| | | PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置上榜段位:%s,积分:%s" % (danLV, pkScore))
|
| | | errorMsg = PlayerCrossRealmPK.GMSetPlayerCrossPKData(curPlayer, danLV, pkScore, cWinCount)
|
| | | if errorMsg:
|
| | | GameWorld.DebugAnswer(curPlayer, "分区赛季异常!")
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置上榜段位:%s,积分:%s" % (danLV, pkScore))
|
| | | return
|
| | |
|
| | | if len(msgList) == 1:
|
| | |
| | |
|
| | | # 重置数据
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TotalScore, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_OnDayScore, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLV, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_PKCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_WinCount, 0)
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayBuyCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_RefreshCount, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayPKCountAwardState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLVAwardState, 0)
|
| | |
| | |
|
| | | if len(msgList) == 2 or len(msgList) % 2 == 0:
|
| | | setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_TotalScore, "积分"],
|
| | | 1:[ChConfig.Def_PDict_CrossPK_OnDayScore, "过天积分"],
|
| | | 2:[ChConfig.Def_PDict_CrossPK_DanLV, "段位"],
|
| | | 3:[ChConfig.Def_PDict_CrossPK_PKCount, "PK次数"],
|
| | | 4:[ChConfig.Def_PDict_CrossPK_WinCount, "胜利次数"],
|
| | |
| | | 7:[ChConfig.Def_PDict_CrossPK_TodayPKCount, "今日PK次数"],
|
| | | 8:[ChConfig.Def_PDict_CrossPK_TodayWinCount, "今日胜利次数"],
|
| | | 9:[ChConfig.Def_PDict_CrossPK_TodayBuyCount, "今日购买次数"],
|
| | | 10:[ChConfig.Def_PDict_CrossPK_RefreshCount, "今日刷新次数"],
|
| | | }
|
| | | indexList = range(len(msgList))
|
| | | for i in indexList[::2]:
|
| | |
| | | def __PrintHelp(curPlayer):
|
| | | GameWorld.DebugAnswer(curPlayer, "重置数据: SetCrossPK 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置数据: SetCrossPK 类型 值")
|
| | | GameWorld.DebugAnswer(curPlayer, "类型:0-积分,1-过天积分,2-段位,3-PK次数,4-胜利次数,5-连胜次数,6-连败次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "7-今日PK次数,8-今日胜利次数,9-今日购买次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "类型:0-积分,2-段位,3-PK次数,4-胜利次数,5-连胜次数,6-连败次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "7-今日PK次数,8-今日胜利次数,9-今日购买次数,10-今日刷新次数")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置历史记录: SetCrossPK 赛季ID 类型 数值")
|
| | | GameWorld.DebugAnswer(curPlayer, "类型:0-段位,1-名次,2-积分,3-奖励等级")
|
| | | GameWorld.DebugAnswer(curPlayer, "当前连败次数: %s" % curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_CLoseCount))
|
| | | GameWorld.DebugAnswer(curPlayer, "设置上榜: SetCrossPK b 段位 [积分]")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置上榜: SetCrossPK b 段位 [积分 连胜]")
|
| | | return
|
| | |
|
| | |
|