#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package GM.Commands.SetCrossPK
|
#
|
# @todo:ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý
|
# @author hxp
|
# @date 2018-12-25
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2018-12-25 21:30"""
|
#-------------------------------------------------------------------------------
|
|
import GameWorld
|
import PlayerControl
|
import PlayerCrossRealmPK
|
import CrossRealmPlayer
|
import IpyGameDataPY
|
import ShareDefine
|
import ChConfig
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param list ²ÎÊýÁбí [npcID]
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(curPlayer, msgList):
|
|
if not msgList:
|
__PrintHelp(curPlayer)
|
return
|
|
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
|
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))
|
return
|
|
if len(msgList) == 1:
|
if msgList[0] != 0:
|
__PrintHelp(curPlayer)
|
return
|
|
# ÖØÖÃÊý¾Ý
|
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_CWinCount, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CLoseCount, 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_DayPKCountAwardState, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLVAwardState, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardState, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, 0)
|
for i in xrange(1, 20):
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonDanLV % i, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonScore % i, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonOrder % i, 0)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardLV % i, 0)
|
|
GameWorld.DebugAnswer(curPlayer, "ÖØÖÿç·þPKÊý¾ÝOK£¡")
|
PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
|
PlayerCrossRealmPK.SyncCrossRealmPKAwardState(curPlayer)
|
PlayerCrossRealmPK.SyncCrossRealmPKHisSeasonInfo(curPlayer)
|
return
|
|
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, "ʤÀû´ÎÊý"],
|
5:[ChConfig.Def_PDict_CrossPK_CWinCount, "Á¬Ê¤´ÎÊý"],
|
6:[ChConfig.Def_PDict_CrossPK_CLoseCount, "Á¬°Ü´ÎÊý"],
|
7:[ChConfig.Def_PDict_CrossPK_TodayPKCount, "½ñÈÕPK´ÎÊý"],
|
8:[ChConfig.Def_PDict_CrossPK_TodayWinCount, "½ñÈÕʤÀû´ÎÊý"],
|
9:[ChConfig.Def_PDict_CrossPK_TodayBuyCount, "½ñÈÕ¹ºÂò´ÎÊý"],
|
}
|
indexList = range(len(msgList))
|
for i in indexList[::2]:
|
setType, value = msgList[i:i+2]
|
if setType not in setTypeDict:
|
continue
|
dictName, chName = setTypeDict[setType]
|
PlayerControl.NomalDictSetProperty(curPlayer, dictName, value)
|
GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ%s: %s" % (chName, value))
|
|
mapZoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)
|
mapSeasonID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, mapZoneID)
|
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, mapSeasonID)
|
PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)
|
return
|
|
if len(msgList) == 3:
|
seasonID, setType, value = msgList
|
setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_SeasonDanLV, "¶Îλ"],
|
1:[ChConfig.Def_PDict_CrossPK_SeasonOrder, "Ãû´Î"],
|
2:[ChConfig.Def_PDict_CrossPK_SeasonScore, "»ý·Ö"],
|
3:[ChConfig.Def_PDict_CrossPK_SeasonAwardLV, "½±ÀøµÈ¼¶"],
|
}
|
if setType not in setTypeDict:
|
__PrintHelp(curPlayer)
|
return
|
dictName, chName = setTypeDict[setType]
|
PlayerControl.NomalDictSetProperty(curPlayer, dictName % seasonID, value)
|
GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÈü¼¾%s%s: %s" % (seasonID, chName, value))
|
return
|
|
__PrintHelp(curPlayer)
|
return
|
|
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, "ÉèÖÃÀúÊ·¼Ç¼: 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 ¶Îλ [»ý·Ö]")
|
return
|
|
|