#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
##@package GM.Commands.PlayerMirror
|
#
|
# @todo:¾µÏñÊý¾Ý
|
# @author hxp
|
# @date 2024-12-26
|
# @version 1.0
|
#
|
# ÏêϸÃèÊö: ¾µÏñÊý¾Ý
|
#
|
#-------------------------------------------------------------------------------
|
#"""Version = 2024-12-26 17:00"""
|
#-------------------------------------------------------------------------------
|
|
import PlayerViewCache
|
import GameWorld
|
|
import base64
|
import random
|
import PyDataManager
|
|
## Ö´ÐÐÂß¼
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param gmList []
|
# @return None
|
def OnExec(curPlayer, gmList):
|
isSendToDB = True
|
return isSendToDB
|
|
def OnGetMergeParam(curPlayer):
|
return []
|
|
def OnMergeServerExec(gmList, tick):
|
## ¿ç·þÖ´ÐÐÃüÁî
|
value = gmList[0]
|
if value == "a":
|
__addFackPackData(gmList[1:])
|
elif value == "d":
|
__delFackPackData()
|
elif value == "p":
|
__printPackData(gmList[1:])
|
return
|
|
def __addFackPackData(gmList):
|
## Ìí¼Ó¼ÙµÄ´ò°üÊý¾Ý£¬Ò»°ãÓÃÓÚ¿ª·¢²âÊÔ¹¦ÄÜÓ㬴ò°üÊý¾ÝÔÚdbÌí¼Ó£¬GameServerÌí¼Ó²é¿´»º´æ
|
#GameWorld.DebugAnswer(None, "¿ç·þGameServerÍæ¼Ò²é¿´Êý¾ÝÊý:%s" % PyDataManager.GetPlayerViewCachePyManager().GetCount())
|
#return
|
addCount = gmList[0] if len(gmList) > 0 else 1
|
startID = gmList[1] if len(gmList) > 1 else 1
|
fightPower = gmList[2] if len(gmList) > 2 else 0
|
serverID = gmList[3] if len(gmList) > 3 else 0
|
#packDataTempKey = gmList[4] if len(gmList) > 4 else ""
|
|
addOKCount = 0
|
for index in range(addCount):
|
fackID = startID + index
|
curCache = PlayerViewCache.FindViewCache(fackID, True)
|
if not curCache:
|
continue
|
propDict = PlayerViewCache.GetCachePropDataDict(curCache)
|
|
if serverID:
|
propDict["AccID"] = "fake%s@test@s%s" % (fackID, serverID)
|
|
if fightPower:
|
propDict["FightPower"] = fightPower + index
|
|
addOKCount += 1
|
|
GameWorld.DebugAnswer(None, "¿ç·þGameServerÌí¼Ó¼ÙÍæ¼Ò²é¿´Êý¾ÝÊý:%s,%s~%s,×Ü:%s"
|
% (addOKCount, startID, fackID, PyDataManager.GetPlayerViewCachePyManager().GetCount()))
|
return
|
|
def __delFackPackData():
|
|
delCount = 0
|
cacheMgr = PyDataManager.GetPlayerViewCachePyManager()
|
for index in range(cacheMgr.GetCount())[::-1]:
|
viewCache = cacheMgr.At(index)
|
if viewCache.PlayerID >= 10000:
|
continue
|
cacheMgr.DelPlayerViewCache(viewCache.PlayerID)
|
delCount += 1
|
|
GameWorld.DebugAnswer(None, "ɾ³ý¼ÙÍæ¼ÒÊý¾ÝÊý:%s" % delCount)
|
return
|
|
def __printPackData(gmList):
|
GameWorld.DebugAnswer(None, "¿ç·þGameServer»º´æÌõÊý:%s,´ò°üÌõÊý:%s"
|
% (PyDataManager.GetPlayerViewCachePyManager().GetCount(),
|
PyDataManager.GetDBPlayerPackDataManager().GetCount()
|
))
|
return
|
|