1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/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