| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #---------------------------------------------------------------------  | 
| #  | 
| #---------------------------------------------------------------------  | 
| ##@package ChPlayer  | 
| # @todo: Íæ¼Ò·â°üÂß¼´¦Àí  | 
| #  | 
| # @author: eggxp  | 
| # @date 2010-3-31  | 
| # @version 4.2  | 
| #  | 
| # @note:   | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #"""Version = 2017-06-22 15:00"""   | 
| #---------------------------------------------------------------------  | 
| import GameWorld  | 
| import IPY_GameServer  | 
| import PlayerTeam  | 
| import ChConfig  | 
| import PlayerControl  | 
| import PlayerFamily  | 
| import PlayerEventCounter  | 
| import PlayerFriend  | 
| import GMCommon  | 
| import ShareDefine  | 
| #import PlayerFamilyTech  | 
| import time  | 
| import ChPyNetSendPack  | 
| import NetPackCommon  | 
| import GameDataRecord  | 
| import UpdatePlayerName  | 
| import GameWorldBoss  | 
| import PlayerFamilyBoss  | 
| import PlayerBourse  | 
| import PlayerZhuXianBoss  | 
| import PlayerXMZZ  | 
| import PlayerTruck  | 
| import PlayerHorsePetBoss  | 
| import PlayerCompensation  | 
| import PlayerFamilyRedPacket  | 
| #import PlayerFamilyStore  | 
| import PlayerSocial  | 
| import PlayerFamilyParty  | 
| #import PlayerSealDemon  | 
| import PlayerBillboard  | 
| import PlayerLVAward  | 
| import PlayerDuJie  | 
| import PlayerFamilySWRH  | 
| import IpyGameDataPY  | 
| import PlayerTalk  | 
| import PlayerStore  | 
| import GameWorldActionControl  | 
| import GameWorldFamilyWar  | 
| import PlayerFBHelpBattle  | 
| import GameWorldSkyTower  | 
| import GMT_CTG  | 
| import PyGameData  | 
| import GMShell  | 
| import IPY_PlayerDefine  | 
| import GameWorldArena  | 
| import CrossLuckyCloudBuy  | 
| import CrossRealmPK  | 
| import CrossChampionship  | 
| import AuctionHouse  | 
| import PlayerAssist  | 
| import PlayerFB  | 
| import PlayerLove  | 
| import PlayerCharm  | 
| import CrossRealmPlayer  | 
| import CrossBattlefield  | 
| import CrossActAllRecharge  | 
| import CrossYaomoBoss  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
|   | 
| def DoRefreshMainServerRole(curPlayer):  | 
|     ## Ë¢Ð±¾·þ½ÇÉ«ÐÅÏ¢  | 
|       | 
|     curTeam = curPlayer.GetTeam()  | 
|     if curTeam:  | 
|         PlayerTeam.Sync_TeamMemberInfo(curTeam)  | 
|     return  | 
|   | 
| ## Íæ¼ÒµÇ¼³õʼ»¯(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks µÇ½˳Ðò, PlayerLogin->PlayerLoadMapState(PlayerLoginLoadMapOK), ´Ë´¦Î´ÉèÖóõʼ»¯×´Ì¬  | 
| def PlayerLogin(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     try:  | 
|         __Func_PlayerLogin(curPlayer, tick)  | 
|     except:  | 
|         curPlayer.Kick(IPY_PlayerDefine.disWaitForPlayerLoinError)  | 
|         import traceback  | 
|         GameWorld.RaiseException("Íæ¼ÒÉÏÏßÂß¼´íÎó\r\n%s" % traceback.format_exc())  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ## Íæ¼ÒµÇ¼³õʼ»¯(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks µÇ½˳Ðò, PlayerLogin->PlayerLoadMapState(PlayerLoginLoadMapOK), ´Ë´¦Î´ÉèÖóõʼ»¯×´Ì¬  | 
| def __Func_PlayerLogin(curPlayer, tick):  | 
|       | 
|     GameWorld.Log("__Func_PlayerLogin mapID=%s" % curPlayer.GetMapID(), curPlayer.GetPlayerID())  | 
|     curPlayer.SetDict(ChConfig.Def_PDict_LoginMapID, curPlayer.GetMapID())  | 
|     #Íæ¼ÒÔÚÏßʱ¼ä³õʼ»¯  | 
|     InitPlayerOnLineTime(curPlayer, tick)  | 
|     #Íæ¼ÒÏìÓ¦ÐÅÏ¢³õʼ»¯  | 
|     InitPlayerOnLineReply(curPlayer, tick)  | 
|     # Í³¼ÆµÇÈëÈËÊý  | 
|     GameDataRecord.PlayerLoginRecord(curPlayer, tick)  | 
|     __DoPlayerLoginServer(curPlayer, tick)  | 
|       | 
|     #֪ͨµØÍ¼·þÎñÆ÷×Ô¼º³õʼ»¯³É¹¦  | 
|     curPlayer.MapServer_InitOK()  | 
|     return  | 
|   | 
| def __DoPlayerLoginServer(curPlayer, tick):  | 
|     ''' Íæ¼ÒµÇ¼ÐèÒª´¦ÀíµÄÄÚÈÝ£¬±¾·þ¼°¿ç·þ·þÎñÆ÷·Ö¿ª  | 
|     '''  | 
|     if GameWorld.IsCrossServer():  | 
|         #¿ç·þPK  | 
|         CrossRealmPK.OnPlayerLoginCrossServer(curPlayer)  | 
|         #ÐÖú  | 
|         PlayerAssist.OnPlayerLoginCrossServer(curPlayer)  | 
|         return  | 
|       | 
|     #Íæ¼Ò¼Ò×åˢР | 
|     #¼Ò×åÈÎÎñÐèҪˢРFamilyLV, µØÍ¼·þÎñÆ÷ÐèÒªÖªµÀFamilyLVÀ´Í¨ÖªÍæ¼Ò¼Ò×åÈÎÎñ´ÎÊý   | 
|     PlayerFamily.PlayerLoginRefreshFamily(curPlayer, tick)  | 
|     #Íæ¼Ò¶ÓÎé³õʼ»¯  | 
|     PlayerTeam.OnPlayerLoginRefreshTeam(curPlayer, tick)  | 
|     #PlayerCompensation.NotifyPlayerCompensation(curPlayer)  | 
|     __UpdOnedayJobPlayerLoginoffTime(curPlayer)  | 
|     CrossRealmPlayer.OnPlayerLogin(curPlayer)  | 
|       | 
|     if not PlayerControl.GetIsTJG(curPlayer):  | 
|         # Ö»ÓÐ֪ͨÂß¼µÄÓ¦¸Ã·Å´Ë´¦¼õÉÙIO£¬ÈçÓÐÂß¼´¦Àí´æ´¢µÈ²»¿É·ÅÔÚ´Ë´¦  | 
|         #ºÃÓÑÐÅϢˢР | 
|         PlayerFriend.OnPlayerLogin(curPlayer, tick)  | 
|           | 
|         #Í¨ÖªÍæ¼ÒµÇ½ÐÅÏ¢£¬À´×ÔÔËÓª·½  | 
|         #DoLogic_LoginUserData(curPlayer)  | 
|       | 
|         #֪ͨ¿ª·þÌìÊý, µÇ¼ʱ¸ÄΪµØÍ¼Í¨Öª£¬ÒòΪGameServerµÄPlayerLoginÔÚµØÍ¼Ö®ºó£¬Ç°¶ËÓÐЩ¹¦ÄÜ´¦ÀíÐèÒªÌáǰµÃµ½¿ª·þÌì  | 
|         #PlayerEventCounter.Sync_OpenServerDay(curPlayer)  | 
|         # Í¨Öª¹ã²¥ÐÅÏ¢  | 
|         GMCommon.SendBroadCastToClient(curPlayer)  | 
|       | 
|         PlayerTruck.SyncPlayerTruckStartTime(curPlayer)  | 
|         #Í¨ÖªÍæ¼Ò½»Ò×Ëù¹Òµ¥Çé¿ö  | 
|         PlayerBourse.OnPlayerLogin(curPlayer)  | 
|         #ÅÄÂôÐÐ  | 
|         AuctionHouse.OnPlayerLogin(curPlayer)  | 
|           | 
|         #ÉÏÏ߹㲥  | 
|         __CheckWorldNotifyOnLogin(curPlayer, tick)  | 
|           | 
|         #ÏÉÃ˺ì°ü  | 
|         PlayerFamilyRedPacket.OnPlayerLogin(curPlayer)  | 
|         #ÏÉÃË²Ö¿â  | 
|         #PlayerFamilyStore.OnPlayerLogin(curPlayer)  | 
|         #ÏÉÃËÑç»á  | 
|         PlayerFamilyParty.OnPlayerLogin(curPlayer)  | 
|         #·âħ̳  | 
|         #PlayerSealDemon.OnPlayerLogin(curPlayer)  | 
|         #ÏÉħ֮Õù  | 
|         PlayerXMZZ.OnXMZZOnLogin(curPlayer)  | 
|         #µÈ¼¶½±Àø  | 
|         PlayerLVAward.OnPlayerLogin(curPlayer)  | 
|         #É̵깺Âò´ÎÊý  | 
|         PlayerStore.OnPlayerLogin(curPlayer)  | 
|         #֪ͨÊÀ½çbossÐÅÏ¢  | 
|         GameWorldBoss.OnPlayerLogin(curPlayer)  | 
|         #¶É½Ù  | 
|         PlayerDuJie.OnPlayerLogin(curPlayer)  | 
|         #ÊØÎÀÈË»Ê  | 
|         PlayerFamilySWRH.OnLogin(curPlayer)  | 
|         PlayerTalk.LoginChatMi(curPlayer)  | 
|         PlayerTalk.NotifyTalkCache(curPlayer)  | 
|         #»î¶¯  | 
|         GameWorldActionControl.OnPlayerLogin(curPlayer)  | 
|         #Íæ¼ÒµÈ¼¶¼Ç¼  | 
|         PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()  | 
|         #¾º¼¼³¡  | 
|         GameWorldArena.OnPlayerLogin(curPlayer)  | 
|         #¿ç·þPK  | 
|         CrossRealmPK.OnPlayerLogin(curPlayer)  | 
|         #ÐÒÔËÔÆ¹º  | 
|         CrossLuckyCloudBuy.OnPlayerLogin(curPlayer)  | 
|         #ÖïÏÉBOSS  | 
|         PlayerZhuXianBoss.OnPlayerLogin(curPlayer)  | 
|         #Æï³èboss״̬֪ͨ  | 
|         PlayerHorsePetBoss.OnLogin(curPlayer)  | 
|         #ÐÖú  | 
|         PlayerAssist.OnPlayerLogin(curPlayer)  | 
|         #ÌìÐÇËþ  | 
|         GameWorldSkyTower.OnPlayerLogin(curPlayer)  | 
|         GMT_CTG.OnPlayerLogin(curPlayer)  | 
|           | 
|     else:  | 
|         pass  | 
|           | 
|     return  | 
|   | 
| def DoPlayerRealLoginOK(curPlayer, loginMsg, tick):  | 
|     ''' Íæ¼Ò×îÖյǼ³É¹¦´¦Àí£¬ ÓÉ  MapServer  DoPlayerRealLoginOK  Í¨Öª  | 
|         ¸Ãº¯ÊýΪµØÍ¼×îÖյǼ³É¹¦²Å»áÖ´Ðе½£¬ÒÔºóһЩ¹¦ÄÜÀàµÄµÇ¼´¦Àí½¨Òé¾ùдµ½ÕâÀï  | 
|         ¾ÉµÄ¹¦ÄÜÏȲ»¶¯( __DoPlayerLoginServer º¯ÊýÖеŦÄÜ)£¬Èç¹ûÓеǼÏà¹ØµÄbugÔÙ¿¼ÂÇÊÇ·ñÒÆ¶¯µ½´Ëº¯Êý  | 
|     '''  | 
|     isMixServerFirstLogin = loginMsg[0]  | 
|     GameWorld.Log("GameServer->DoPlayerRealLoginOK, isMixServerFirstLogin=%s" % isMixServerFirstLogin, curPlayer.GetPlayerID())  | 
|       | 
|     if GameWorld.IsCrossServer():  | 
|         return  | 
|       | 
|     PyGameData.g_dbPlayerIDMap[curPlayer.GetPlayerID()] = curPlayer.GetAccID()  | 
|       | 
|     if not PlayerControl.GetIsTJG(curPlayer):  | 
|         #¼Ò×帱±¾boss״̬֪ͨ  | 
|         PlayerFamilyBoss.OnLogin(curPlayer)  | 
|         #÷ÈÁ¦  | 
|         PlayerCharm.OnPlayerLogin(curPlayer)  | 
|         #ÇéÔµ  | 
|         PlayerLove.OnPlayerLogin(curPlayer)  | 
|         #¿ç·þÕ½³¡  | 
|         CrossBattlefield.OnPlayerLogin(curPlayer)  | 
|         #¿ç·þÅÅλ  | 
|         CrossChampionship.OnPlayerLogin(curPlayer, tick)  | 
|         #¿ç·þÈ«Ãñ³äÖµ  | 
|         CrossActAllRecharge.OnPlayerLogin(curPlayer)  | 
|         #¿ç·þÑýħboss  | 
|         CrossYaomoBoss.OnPlayerLogin(curPlayer)  | 
|           | 
|     if isMixServerFirstLogin:  | 
|         PlayerCharm.OnMixServerFirstLogin(curPlayer)  | 
|           | 
|     PyGameData.g_noPlayerLoginWarningMailState = 2  | 
|     return  | 
|   | 
| def __UpdOnedayJobPlayerLoginoffTime(curPlayer):  | 
|     ## ¸üÐÂÒ»ÌìÄÚÖ°Òµ¶ÔÓ¦Íæ¼ÒµÇ¼¡¢ÀëÏßʱ¼ä  | 
|     job = curPlayer.GetJob()  | 
|     playerID = curPlayer.GetPlayerID()  | 
|     if job not in PyGameData.g_onedayJobPlayerLoginoffTimeDict:  | 
|         PyGameData.g_onedayJobPlayerLoginoffTimeDict[job] = {}  | 
|     playerLoginoffTimeDict = PyGameData.g_onedayJobPlayerLoginoffTimeDict[job]  | 
|     playerLoginoffTimeDict[playerID] = int(time.time())  | 
|     #GameWorld.DebugLog("¸üÐÂÖ°Òµ¶ÔÓ¦Íæ¼ÒµÇ¼ÀëÏßʱ¼ä: %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)  | 
|     return  | 
|   | 
| def CheckOnedayJobPlayerLoginoffTimeout():  | 
|     ## ¼ì²éÒ»ÌìÄÚÖ°Òµ¶ÔÓ¦Íæ¼ÒµÇ¼¡¢ÀëÏßʱ¼ä³¬Ê±Íæ¼Ò£¬Ã¿Ð¡Ê±¼ì²éÒ»´Î  | 
|       | 
|     maxTime = 24 * 3600 # Ôݶ¨24Сʱ  | 
|     curTime = int(time.time())  | 
|     #GameWorld.DebugLog("´¦Àí24СʱÄÚÔÚÏߵĽÇÉ«Ö°ÒµÍæ¼Ò: curTime=%s,maxTime=%s, %s" % (curTime, maxTime, PyGameData.g_onedayJobPlayerLoginoffTimeDict))  | 
|       | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|     for playerDict in PyGameData.g_onedayJobPlayerLoginoffTimeDict.values():  | 
|         for playerID, loginoffTime in playerDict.items():  | 
|             if playerManager.FindPlayerByID(playerID):  | 
|                 #GameWorld.DebugLog("    ÔÚÏß²»´¦Àí, playerID=%s" % playerID)  | 
|                 continue  | 
|             if curTime - loginoffTime > maxTime:  | 
|                 playerDict.pop(playerID)  | 
|                 #GameWorld.DebugLog("    ³¬Ê±Íæ¼Ò£¬ÒƳý! playerID=%s,loginoffTime=%s" % (playerID, loginoffTime))  | 
|     #GameWorld.DebugLog("    ´¦ÀíÍê±Ï£¬Ê£ÓàÍæ¼Ò! %s" % PyGameData.g_onedayJobPlayerLoginoffTimeDict)  | 
|     return  | 
|   | 
| ## Ôö¼Ó¸ßÊÖÍæ¼ÒÉÏÏ߹㲥  | 
| #  @param curPlayer  | 
| #  @return None  | 
| def __CheckWorldNotifyOnLogin(curPlayer, tick):  | 
|     # ¿ç·þ·þÎñÆ÷²»¹ã²¥  | 
|     if GameWorld.IsCrossServer():  | 
|         return  | 
|       | 
|     limitLV = IpyGameDataPY.GetFuncCfg("BillBoardPlayerLoginNotify", 2) # ×îµÍµÈ¼¶ÏÞÖÆ  | 
|       | 
|     if curPlayer.GetLV() < limitLV:  | 
|         return  | 
|       | 
|     notifyCD = IpyGameDataPY.GetFuncCfg("BillBoardPlayerLoginNotify", 3)  | 
|     LogoffTime = GetPlayerLeaveServerSecond(curPlayer)  | 
|     if LogoffTime and LogoffTime < notifyCD:  | 
|         #¾àÀëÉÏ´ÎÀëÏßµÄʱ¼äCD  | 
|         return  | 
|        | 
|     notifyCheckList = IpyGameDataPY.GetFuncEvalCfg("BillBoardPlayerLoginNotify")  | 
|     msgMark = ""  | 
|     for checkMark, notifyDict in notifyCheckList:  | 
|           | 
|         # ÅÅÐаñÀàÐÍ  | 
|         if isinstance(checkMark, int):  | 
|             if checkMark not in ShareDefine.BillboardTypeList:  | 
|                 continue  | 
|               | 
|             billboard = GameWorld.GetBillboard().FindBillboard(checkMark)  | 
|             if not billboard:  | 
|                 continue  | 
|               | 
|             billboardCnt = billboard.GetCount()  | 
|             maxOrder = max(notifyDict)  | 
|             for index in range(0, maxOrder):  | 
|                 if index < 0 or index >= billboardCnt:  | 
|                     continue  | 
|                   | 
|                 order = index + 1  | 
|                   | 
|                 if order not in notifyDict:  | 
|                     continue  | 
|                   | 
|                 objBillboard = billboard.At(index)  | 
|                 if curPlayer.GetID() == objBillboard.GetID():  | 
|                     msgMark = notifyDict[order]  | 
|                     break             | 
|           | 
|         # ÓпÉÒԹ㲥µÄ£¬ÂíÉϹ㲥£¬Í˳ö£¬²»ÔÙ¼ì²é  | 
|         if msgMark:  | 
|             PlayerControl.WorldNotify(0, msgMark, [curPlayer.GetName()])  | 
|             break  | 
|       | 
|     return  | 
|   | 
| ##»ñµÃÍæ¼Òµ±Ç°ÀۼƵÄÀëÏßÃëÊý  | 
| # @param curPlayer Íæ¼ÒʵÀý  | 
| # @return ÀۼƵÄÃëÊý  | 
| # @remarks ¿Í»§¶Ë·â°üÏìÓ¦  | 
| def GetPlayerLeaveServerSecond(curPlayer):  | 
|     #µ±Ç°ÀëÏßʱ¼ä×Ö·û´«  | 
|     logoffTimeStr = curPlayer.GetLogoffTime()  | 
|   | 
|     if logoffTimeStr == "" or logoffTimeStr == '0':  | 
|         return 0  | 
|   | 
|     logoffTime = GameWorld.GetDateTimeByStr(logoffTimeStr)  | 
|     loginTime = GameWorld.GetDateTimeByStr(GameWorld.GetCurrentDataTimeStr())  | 
|   | 
|     diff_Time = loginTime - logoffTime  | 
|     #ÌìÊý * 24Сʱ * 60 ·ÖÖÓ + Ãë  | 
|     return diff_Time.days * 24 * 60 * 60 + diff_Time.seconds  | 
|   | 
| ## ÔËÓªµÇ½ÐÅÏ¢´¦Àí  | 
| #  @param curPlayer  | 
| #  @return None  | 
| def DoLogic_LoginUserData(curPlayer):  | 
|     curPlayerUserData = GameWorld.GetUserData(curPlayer)  | 
|     if not curPlayerUserData:  | 
|         return  | 
|       | 
|     #Õ˺ż¤»î½±Àø  | 
|     ActivateAccountAward(curPlayer, curPlayerUserData)  | 
|       | 
|     SyncOPPlayerLoginInfo(curPlayer, curPlayerUserData)  | 
|     #NotifyGameWallowInfo  | 
|     return  | 
|   | 
|   | 
| ## ¸ù¾Ýkey»ñÈ¡Óû§ÐÅÏ¢  | 
| #  @param curPlayer  | 
| #  @param key  | 
| #  @param default  | 
| #  @return  | 
| def GetUserDataByKey(curPlayer, key, default=None):  | 
|     playerUserDataStr = curPlayer.GetUserData()  | 
|       | 
|     if not playerUserDataStr:  | 
|         return default  | 
|       | 
|     try:  | 
|         curPlayerUserData = eval(playerUserDataStr)  | 
|     except:  | 
|         GameWorld.ErrLog("data error UserData = %s"%curPlayerUserData )  | 
|         return default  | 
|       | 
|     if not isinstance(curPlayerUserData, dict):  | 
|         GameWorld.ErrLog("type error UserData = %s"%curPlayerUserData )  | 
|         return default  | 
|       | 
|     return curPlayerUserData.get(key, default)  | 
|   | 
| # Ñ¸À×ÐÅÏ¢  | 
| #curPlayerUserData={'username': 'alee',   | 
| #'cm': '1', 'agent': 'xunlei', 'goldlevel': '2', 'viplevel': '3',   | 
| #'serverid': '1', 'isvip': '1', 'clienttype': '1', 'isgoldvip': '1', 'paytype': '1',   | 
| #'token': '6fb3a97df0bb3c142593a11a95a1688b', 'time': '1393575021', 'viptype': '2'}  | 
|   | 
|   | 
| ## Í¨ÖªMAPƽ̨µÇ½ÐÅÏ¢  | 
| #  @param curPlayer  | 
| #  @return µÇ½ÐÅÏ¢×Ö·û´®  | 
| def SyncOPPlayerLoginInfo(curPlayer, userDict):  | 
|     if userDict.get('agent', "") == "xunlei":  | 
|         isvip = int(userDict.get('isvip', 0))  | 
|         curPlayer.SetDict("XunLeiVIP", isvip)  | 
|         #ѸÀ×Óû§£¬Ñ¸À×VIP£¬VIPµÈ¼¶£¬½ð¿¨VIP£¬½ð¿¨µÈ¼¶, µÇ¼¿Í»§¶ËÀàÐÍ  | 
|         result = ['xunlei', isvip, int(userDict.get('viplevel', 0)), int(userDict.get('isgoldvip', 0)),   | 
|                   int(userDict.get('goldlevel', 0)), int(userDict.get('clienttype', 0))]  | 
|     else:  | 
|         result = [int(userDict.get('clienttype', 0)), userDict.get('channel_code', ""),]  | 
|           | 
|     pid = GameWorld.ToIntDef(userDict.get('pid', "0"))  | 
|     curPlayer.SetDict(ChConfig.Def_PlayerKey_PlayerFromPID, pid)  | 
|       | 
|     platform = userDict.get('pf', "")  | 
|     if not platform:  | 
|         platform = userDict.get('platform', "")  | 
|           | 
|     account_type = GameWorld.ToIntDef(userDict.get('qidtype', "0"))  | 
|       | 
|     result.extend([pid, platform, account_type])  | 
|           | 
|     # µ± pf Îª qzone¡¢pengyou¡¢qplus Ê±£¬·¢ËÍ»Æ×êÐÅÏ¢  | 
|     if platform in ["qzone", "pengyou", "qplus"]:  | 
|         result.extend([int(userDict.get('is_yellow', 0)), int(userDict.get('is_year_yellow', 0)),   | 
|                        int(userDict.get('is_high_yellow', 0)), int(userDict.get('yellow_level', 0))])  | 
|           | 
|     # µ± pf Îª qqgame¡¢3366 Ê±£¬·¢ËÍÀ¶×êÐÅÏ¢  | 
|     elif platform in ["qqgame", "3366"]:  | 
|         result.extend([int(userDict.get('is_blue', 0)), int(userDict.get('is_year_blue', 0)),   | 
|                        int(userDict.get('is_high_blue', 0)), int(userDict.get('blue_level', 0))])  | 
|           | 
|     result = str(result)  | 
|     curPlayer.MapServer_QueryPlayerResult(0, 0, "LoginData", result, len(result))  | 
|     return  | 
|   | 
|       | 
| ## Õ˺ż¤»î½±Àø  | 
| #  @param Userdict  | 
| #  @return None  | 
| def ActivateAccountAward(curPlayer, userDict):  | 
|     if not userDict.has_key("activateType"):  | 
|         return  | 
|       | 
|     msg = str(userDict["activateType"])  | 
|       | 
|     curPlayer.MapServer_QueryPlayerResult(0, 0, 'ActivateAward', msg, len(msg))  | 
|   | 
|       | 
| ## Í¨ÖªÍæ¼Ò·À³ÁÃÔÐÅÏ¢  | 
| #  @param curPlayer: Íæ¼ÒʵÀý  | 
| #  @return: None  | 
| def NotifyGameWallowInfo(curPlayer):  | 
|       | 
|     return  | 
|     playerUserDataStr = curPlayer.GetUserData()  | 
|       | 
|     if not playerUserDataStr:  | 
|         return  | 
|       | 
|     curPlayerUserData = eval(playerUserDataStr)  | 
|   | 
|     GameWorld.Log("type=%s, curPlayerUserData=%s"%(type(curPlayerUserData), curPlayerUserData))  | 
|     #º«¹ú°æÓÐcurPlayerUserDataÊý¾Ý  | 
|     if not curPlayerUserData:  | 
|         GameWorld.Log("not curPlayerUserData=%s"%curPlayerUserData )  | 
|         return  | 
|       | 
|     try:  | 
|         curPlayerAge = int(curPlayerUserData["data"]["result"]["age"])  #ÄêÁä  | 
|         endTime = curPlayerUserData["data"]["result"]["endtime"]    #½áÊøÊ±¼ä  | 
|     except BaseException:  | 
|         GameWorld.ErrLog("curPlayerAge or endTime ##Error!" )  | 
|         return  | 
|   | 
|     #ÏÖÔÚʱ¼ä  | 
|     #curPlayerAge = 15 #ÄêÁä  | 
|     #endTime = ""    #½áÊøÊ±¼ä  | 
|   | 
|     if not curPlayerAge:  | 
|         GameWorld.ErrLog("curPlayerAge:%s not ##Error!"%curPlayerAge )  | 
|         return  | 
|   | 
|     if endTime:  | 
|         if not GameWorld.GetDateTimeByStr(endTime):  | 
|             GameWorld.ErrLog("endTime:%s Format ##Error!"%endTime )  | 
|             return  | 
|         endTime = int(time.mktime(time.strptime(endTime,"%Y-%m-%d %H:%M:%S")))   | 
|     else:  | 
|         endTime = 0  | 
|       | 
| #    packData = ChPyNetSendPack.tagInfoGameWallow()  | 
| #    packData.Clear()  | 
| #    packData.Age = curPlayerAge  | 
| #    packData.EndTime = endTime  | 
| #    GameWorld.Log("Í¨ÖªÍæ¼Ò·À³ÁÃÔÐÅÏ¢,packData.Age=%s ,packData.EndTime=%s"%(packData.Age,packData.EndTime))  | 
| #    NetPackCommon.SendFakePack(curPlayer, packData)  | 
|       | 
|     return  | 
|   | 
| ## ·¢ËÍÇëÇóÖÁÄ¿±êµØÍ¼(ÈÎÎñÐèÒªµÇ½¼Ò×峤´¥·¢Ê¼þ)  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __RefreshFamilyToMapServer(curPlayer):  | 
|     curFamily = curPlayer.GetFamily()  | 
|       | 
|     if not curFamily:  | 
|         #Íæ¼ÒÎÞ¼Ò×å  | 
|         return  | 
|       | 
|     playerID = curPlayer.GetPlayerID()  | 
|     curMember = curFamily.FindMember(playerID)  | 
|       | 
|     if not curMember:  | 
|         GameWorld.ErrLog("ˢмÒ×åÊôÐÔʧ°Ü, ¼Ò×å³ÉÔ±²éÕÒÒì³£ = %s"%(playerID))  | 
|         return  | 
|       | 
|     tagMapID = GameWorld.GetQueryPlayerMapID(curPlayer)  | 
|       | 
|     if not tagMapID:  | 
|         GameWorld.ErrLog("ˢмÒ×åÊôÐÔʧ°Ü, ¼Ò×å³ÉÔ±²éÕÒÒì³£ tagMapID = %s"%(tagMapID))  | 
|         return  | 
|       | 
|     sendCMD = "0"  | 
|       | 
|     if curMember.GetFamilyLV() == IPY_GameServer.fmlLeader:  | 
|         sendCMD = "1"  | 
|       | 
|     queryCallName = "Refresh_Family_Info"  | 
|       | 
|     #֪ͨMapServer½á¹û´¦Àí  | 
|     GameWorld.GetPlayerManager().MapServer_QueryPlayer(playerID, ChConfig.queryType_sqtRefresh_Family_Info,   | 
|                     playerID, tagMapID, queryCallName, sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())  | 
|     return  | 
|       | 
|   | 
| ## Íæ¼ÒÔÚÏßʱ¼ä³õʼ»¯   | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def InitPlayerOnLineTime(curPlayer, tick):  | 
|     curPlayer.SetLoginTick(tick)  | 
|     return  | 
|   | 
| ## Íæ¼ÒÏìÓ¦ÐÅÏ¢³õʼ»¯   | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def InitPlayerOnLineReply(curPlayer, tick):  | 
|     curPlayer.SetOnlineReplyErrorCount(0)  | 
|     curPlayer.SetOnlineReplyTick(0)  | 
|     return  | 
|   | 
| ## Íæ¼ÒÏÂÏß(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def PlayerDisconnect(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     try:  | 
|         __Func_PlayerDisconnect(curPlayer, tick)  | 
|     except:  | 
|         import traceback  | 
|         GameWorld.RaiseException("Íæ¼ÒÏÂÏßÂß¼´íÎó\r\n%s" % traceback.format_exc())  | 
|     #µ÷ÓõײãÏÂÏß  | 
|     curPlayer.DoDisconnect()  | 
|     return  | 
|   | 
| ## Íæ¼ÒÏÂÏß(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __Func_PlayerDisconnect(curPlayer, tick):  | 
|       | 
|     if GameWorld.IsCrossServer():  | 
|         PlayerFB.OnPlayerDisconnectCrossServer(curPlayer)  | 
|           | 
|     #¿ç·þÆ¥ÅäPK  | 
|     CrossRealmPK.OnLeaveServer(curPlayer)  | 
|       | 
|     #×é¶ÓÍæ¼ÒÀëÏß  | 
|     PlayerTeam.DoPlayerLogOffTeamLogic(curPlayer, tick)  | 
|     #¼Ò×åÍæ¼ÒÀëÏß  | 
|     PlayerFamily.PlayerLogoffRefreshFamily(curPlayer, tick)  | 
|     PlayerFriend.OnPlayerDisconnect(curPlayer, tick)  | 
|       | 
|     __UpdOnedayJobPlayerLoginoffTime(curPlayer)  | 
|     # ÉèÖüÒ×å³ÉÔ±ÀëÏßʱ¼ä  | 
|     SetPlayerOfflineTime(curPlayer)  | 
|     #ÅÄÂôÐÐ  | 
|     AuctionHouse.OnPlayerLeaveServer(curPlayer)  | 
|     #ÐÖú  | 
|     PlayerAssist.OnLeaveServer(curPlayer)  | 
|     #ºì°ü  | 
|     PlayerFamilyRedPacket.OnLeaveServer(curPlayer)  | 
|     #------------ïÚ³µÂß¼  | 
|     #TruckPlayerDisconnectProcess(curPlayer, tick)  | 
|       | 
|     if not PlayerControl.GetIsTJG(curPlayer):  | 
|         playerID = curPlayer.GetPlayerID()  | 
|         PyGameData.g_unTJLogoffTime[playerID] = int(time.time())  | 
|           | 
|     return  | 
|   | 
| ## ÉèÖÃÍæ¼ÒÀëÏßʱ¼ä  | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def SetPlayerOfflineTime(curPlayer):  | 
|     #if PlayerControl.GetIsTJG(curPlayer):  | 
|     #    return  | 
|       | 
|     curPlayerID = curPlayer.GetPlayerID()  | 
|     curFamily = curPlayer.GetFamily()  | 
|     if not curFamily:  | 
|         return  | 
|     curMember = curFamily.FindMember(curPlayerID)  | 
|     curTimeStr = GameWorld.GetCurrentDataTimeStr()  | 
|     curTimeTuple = time.strptime(curTimeStr, ChConfig.TYPE_Time_Format)  | 
|     curTimeNum = int(time.mktime(curTimeTuple))  | 
|   | 
|     curMember.SetExattr2(curTimeNum)  | 
|   | 
| ## ïÚ³µÂß¼(²ÎÊý -> µ±Ç°Íæ¼Ò,µ±Ç°Ê±¼ä)  | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def TruckPlayerDisconnectProcess(curPlayer, tick):  | 
| #    #ïÚ³µ¹ÜÀíÆ÷  | 
| #    truckMananger = GameWorld.GetTruckMananger()  | 
| #    curPlayerTruck = truckMananger.FindTruckByOwner(curPlayer.GetPlayerID())  | 
| #    #¸ÃÍæ¼ÒÎÞïÚ³µ  | 
| #    if curPlayerTruck == None :  | 
| #        return  | 
| #    #ÉèÖüÆËãïÚ³µÏûʧʱ¼ä  | 
| #    curPlayerTruck.SetLogoffTick(tick)  | 
|     return  | 
|   | 
| ## Ë¢ÐÂÍæ¼ÒÃû×Ö(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def RefreshName(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     playerNamePack = IPY_GameServer.IPY_GRefreshPlayerName()  | 
|     curPlayer.SetName(playerNamePack.GetName())  | 
|     return  | 
|   | 
| ## Ë¢ÐÂ״̬(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def RefreshState(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|       | 
|     if curPlayer == None:  | 
|         GameWorld.Log("RefreshState, index = %d, player = None"%(index))  | 
|         return  | 
|       | 
|     playerStatePack = IPY_GameServer.IPY_GRefreshPlayerProperty()  | 
|     packValue = playerStatePack.GetValue()  | 
|     packValueEx = playerStatePack.GetValueEx()  | 
|     packType = playerStatePack.GetType()  | 
|       | 
|     #---ÌØÊâÂß¼´¦Àí---  | 
|     if packType == ShareDefine.CDBPlayerRefresh_ForbidenTalk:  | 
|         PlayerControl.SetGMForbidenTalk(curPlayer, packValue)  | 
|         return  | 
|       | 
|     if packType == ShareDefine.CDBPlayerRefresh_ExAttr17:  | 
|         PlayerControl.SetPlayerAccState(curPlayer, packValue)  | 
|         return  | 
|   | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_State:  | 
|         # ÍÑ»úÔÚÏß  | 
|         PlayerControl.SetIsTJG(curPlayer, packValue)  | 
|         return  | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_HappyPoint:  | 
|         # ÍÑ»úʱ¼ä  | 
|         PlayerControl.SetTJGTime(curPlayer, packValue)  | 
|         return  | 
|       | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_FamilyActiveValue:  | 
|         #¼Ò×å»îÔ¾¶ÈˢР | 
|         PlayerFamily.ReFreshPlayerFamilyActiveValue(curPlayer, packValue)  | 
|         return  | 
|       | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_FightPower:  | 
|         curPlayer.SetFightPower(packValue, packValueEx)  | 
|         return  | 
|   | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr2:  | 
|         #¶ÓÎéÏà¹ØÏà¹ØÉóºË¿ª¹Ø×´Ì¬  | 
|         PlayerTeam.SetTeamCheckState(curPlayer, packValue)  | 
|         return  | 
|       | 
|     #if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1:  | 
|     #    PlayerControl.SetAssistTagPlayerID(curPlayer, packValue)  | 
|     #    return  | 
|       | 
|     if packType == IPY_GameServer.CDBPlayerRefresh_ExAttr3:  | 
|         PlayerControl.SetFBFuncLineID(curPlayer, packValue)  | 
|         return  | 
|       | 
|     #---³£¹æÂß¼´¦Àí---  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_LV:  | 
|         curPlayer.SetLV(packValue)  | 
|         #Íæ¼ÒµÈ¼¶¼Ç¼  | 
|         playerID = curPlayer.GetID()  | 
|         if playerID in PyGameData.g_todayPlayerLVDict:  | 
|             PyGameData.g_todayPlayerLVDict[playerID] = packValue  | 
|   | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_Job:  | 
|         if packValue != curPlayer.GetJob():  | 
|             PlayerBillboard.DelJobFightPowerBillboard(curPlayer, curPlayer.GetJob())  | 
|         curPlayer.SetJob(packValue)  | 
|           | 
| #    elif packType == IPY_GameServer.CDBPlayerRefresh_CurrentPlayerType:  | 
| #        #ÕâÀïÓ¦¸Ã֪ͨ×é¶ÓÄDZßˢР | 
| #        curPlayer.SetCurrentProperty(packValue)  | 
| #        __RefreshTeamState(curPlayer)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_MapID:  | 
|         #Íæ¼ÒÇл»µØÍ¼  | 
|         curPlayer.SetMapID(packValue)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_RealMapID:  | 
|         #Íæ¼ÒµÄÕæÊµµØÍ¼ID  | 
|         curPlayer.SetRealMapID(packValue)  | 
|         OnPlayerChangeRealMap(curPlayer, tick)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_FBID:  | 
|         curPlayer.SetFBID(packValue)  | 
|       | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_VIPLv:  | 
|         curPlayer.SetVIPLv(packValue);  | 
| #        __RefreshTeamState(curPlayer)  | 
|       | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr5:  | 
|         PlayerControl.SetCrossMapID(curPlayer, packValue, False)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr9:  | 
|         curPlayer.SetExAttr9(packValue)  | 
|         #PlayerControl.SetVIPExpireTime(curPlayer, packValue)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr10:  | 
|         PlayerControl.SetChatBubbleBox(curPlayer, packValue)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr13:  | 
|         PlayerControl.SetPlayerServerGroupID(curPlayer, packValue)  | 
|           | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_OperateInfo:  | 
|         curPlayer.SetOperateInfo(packValue);  | 
|       | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_OfficialRank:  | 
|         curPlayer.SetOfficialRank(packValue)  | 
|         #¸üÐÂÅÅÐаñµÄ¾³½ç  | 
|         PlayerBillboard.UpdateBillboardRealm(curPlayer)  | 
|     elif packType == IPY_GameServer.CDBPlayerRefresh_Face:  | 
|         curPlayer.SetFace(packValue)  | 
|         PlayerBillboard.UpdateBillboardFace(curPlayer)  | 
|           | 
|     #Éç½»ÐÅÏ¢  | 
|     PlayerSocial.UpdateSocialInfo(curPlayer.GetID(), packType, packValue)  | 
|     #×é¶Ó³ÉԱˢР | 
|     PlayerTeam.PlayerTeamMemberRefresh(curPlayer, packType, packValue, tick)  | 
|     #¼Ò×åˢР | 
|     PlayerFamily.PlayerRefresh(curPlayer, tick)  | 
|     #¸±±¾ÖúÕ½  | 
|     PlayerFBHelpBattle.UpdateCheckInPlayerInfoByRefresh(curPlayer, packType, packValue)  | 
|     return  | 
|   | 
| ## Íæ¼ÒÇл»µØÍ¼µÄÏìÓ¦(²ÎÊý -> µ±Ç°Íæ¼Ò,µ±Ç°Ê±¼ä)  | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnPlayerChangeMap(curPlayer, tick):  | 
|     #δ³õʼ»¯³É¹¦²»´¦Àí  | 
|     if not curPlayer.GetInitOK():  | 
|         #GameWorld.ErrLog("Çл»µØÍ¼, Íæ¼Ò³õʼ»¯²»³É¹¦£¬²»Ö´ÐÐÏà¹ØÂß¼", curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     GameWorld.Log("Íæ¼Ò : %s,%s,FBID=%s Çл»µØÍ¼" % (curPlayer.GetName(), curPlayer.GetRealMapID(), curPlayer.GetFBID()) , curPlayer.GetPlayerID())  | 
|     PlayerTeam.OnPlayerChangeMap(curPlayer, tick)  | 
|     GameWorldBoss.OnPlayerChangeMap(curPlayer)  | 
|     PlayerFamily.OnPlayerChangeMap(curPlayer, tick)  | 
|     PlayerFamilyParty.OnPlayerChangeMap(curPlayer, tick)  | 
|     GameWorldFamilyWar.OnPlayerChangeMap(curPlayer)  | 
|     return   | 
|   | 
| ## Íæ¼ÒÇл»ÕæÊµµØÍ¼  | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnPlayerChangeRealMap(curPlayer , tick):  | 
| #===============================================================================  | 
| #    Çл»µØÍ¼·â°üʱÐò  | 
| #    CDBPlayerRefresh_MapID  | 
| #    CDBPlayerRefresh_FBID  | 
| #    CDBPlayerRefresh_RealMapID  | 
| #===============================================================================  | 
|     #¿ªÊ¼µØÍ¼³õʼ»¯¶¯×÷  | 
|     OnPlayerChangeMap(curPlayer, tick)  | 
|     return  | 
|   | 
| ## ¼ì²éÍæ¼ÒÏìӦʱ¼ä(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def PlayerOnlineReply(index, tick):  | 
|     #Ŀǰ×öµ½RouteServerÖÐÈ¥ÁË  | 
| #    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
| #      | 
| #    curPlayer.Sync_OnlineReplyAnswer()  | 
| #    if curPlayer.GetOnlineReplyTick() == 0:  | 
| #        curPlayer.SetOnlineReplyTick(tick)  | 
| #        return  | 
| #      | 
| #    #ÏìӦʱ¼ä¼ì²â(5ÃëÕý³£¼Ç¼,10ÃëÌßÏÂÏß,10´Î´íÎóÌßÏÂÏß)  | 
| #    playerOnlineReplayTime = abs( tick - curPlayer.GetOnlineReplyTick() - ChConfig.Def_PlayerOnLineReply_ClientReply)  | 
| #    #²»ÁôÇé,Ö±½ÓÌß  | 
| #    if playerOnlineReplayTime >= ChConfig.Def_PlayerOnLineReply_MaxTick:  | 
| #        GameWorld.Log("ÏìÓ¦´íÎó,ʱ¼ä³¬¹ý%s,ÌßÏÂÏß"%(ChConfig.Def_PlayerOnLineReply_MaxTick))  | 
| #        curPlayer.Kick(IPY_GameServer.disTimeError)  | 
| #        return True  | 
| #    #¼Ç¼  | 
| #    elif playerOnlineReplayTime >= ChConfig.Def_PlayerOnLineReply_NoteTick:  | 
| #        curPlayer.SetOnlineReplyErrorCount( curPlayer.GetOnlineReplyErrorCount() + 1 )  | 
| #        GameWorld.Log("ÏìÓ¦´íÎó,Òѱ»¼Ç¼,µ±Ç°´ÎÊý%s"%(curPlayer.GetOnlineReplyErrorCount()))  | 
| #    #¼ì²é´íÎó´ÎÊý,Ö±½ÓÌß  | 
| #    if curPlayer.GetOnlineReplyErrorCount() >= ChConfig.Def_PlayerOnLineReply_ErrorCount:  | 
| #        GameWorld.Log("ÏìÓ¦´íÎó,´íÎó´ÎÊý³¬¹ý%s,ÌßÏÂÏß"%(ChConfig.Def_PlayerOnLineReply_ErrorCount))  | 
| #        curPlayer.Kick(IPY_GameServer.disTimeError)  | 
| #        return True  | 
| #    #ÉèÖõ±Ç°Ê±¼ä  | 
| #    curPlayer.SetOnlineReplyTick(tick)  | 
|       | 
|     return True  | 
|   | 
| #//////////////////////////////////////////////////////////////  | 
| #//01 03 Íæ¼ÒµÇ¼µØÍ¼³õʼ»¯#tagGPlayerLoadMap  | 
| #tagGPlayerLoadMap       *   GettagGPlayerLoadMap();  | 
| #  | 
| #class   IPY_GPlayerLoadMap  | 
| #{  | 
| #public:  | 
| #    //0: ¿ªÊ¼¶ÁÈ¡ 1: ¶ÁÈ¡³É¹¦  | 
| #    int      GetLoadState();  | 
| #};  | 
|   | 
| ## Íæ¼ÒµÚÒ»´Î½øÈëÓÎÏ·³õʼ»¯(²ÎÊý -> µ±Ç°Íæ¼Ò,µ±Ç°Ê±¼ä)  | 
| #  @param curPlayer  µ±Ç°Íæ¼Ò   | 
| #  @param tick µ±Ç°Ê±¼ä   | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def PlayerLoginLoadMapOK(curPlayer, tick):  | 
|     #ÔÚÍæ¼Ò·¢À´·â°ü, µØÍ¼¶ÁÈ¡³É¹¦ºó´¥·¢  | 
|     GameWorld.Log("%s µÇ¼, accID = %s, IP = %s, MapID = %s"%(curPlayer.GetName(), curPlayer.GetAccID(), curPlayer.GetIP(), curPlayer.GetRealMapID()) , curPlayer.GetPlayerID())  | 
|     #·¢Ë͸ø¿Í»§¶Ë·â°üͬ²½Ê±¼ä¸ÄÓÃA0 04  | 
|     #curPlayer.Sync_ServerDataTimeToClient()  | 
|     #¸Äµ½mapServerµÇ¼³É¹¦Í¨Öª  | 
|     #Sync_PyServerDataTimeToClient(curPlayer, tick)  | 
|       | 
|     if GameWorld.IsCrossServer():  | 
|         PlayerFB.PlayerLoginLoadCrossMapOK(curPlayer)  | 
|           | 
|     PlayerTeam.OnPlayerReadMapOK(curPlayer, tick)  | 
|       | 
|     #Ë¢ÐÂÈËÎïÈÕÆÚ״̬  | 
|     PlayerEventCounter.UpdatePlayerLoginTime(curPlayer)  | 
|       | 
| #===============================================================================  | 
| #    #¸±±¾»î¶¯½çÃæÐÞ¸ÄΪ, Íæ¼Òµã»÷NPC´¥·¢, 2010-07-02  | 
| #    if GameWorld.GetGameWorld().GetGameFbEventList().GetGameFbEventListCount() != 0:  | 
| #        #»î¶¯¸±±¾²»Îª0, Í¨Öª¿Í»§¶ËËùÓи±±¾×´Ì¬  | 
| #        curPlayer.Sync_GameFbEvent()  | 
| #===============================================================================  | 
|     #×Ô¼ºÒѾ³õʼ»¯³É¹¦  | 
|     curPlayer.SetInitOK(True)  | 
|     GMShell.OnPlayerLogin(curPlayer)  | 
|     #·¢ËÍÇëÇóÖÁÄ¿±êµØÍ¼(ÈÎÎñÐèÒªµÇ½¼Ò×峤´¥·¢Ê¼þ)  | 
|     __RefreshFamilyToMapServer(curPlayer)  | 
|     return  | 
|   | 
| ## Íæ¼Ò¶ÁÈ¡µØÍ¼×´Ì¬(·â°ü²ÎÊý)  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def PlayerLoadMapState(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameServer.IPY_GPlayerLoadMap()  | 
|     if pack.GetLoadState() == 0:  | 
|         curPlayer.SetIsLoadMap(True)  | 
|         return  | 
|       | 
|     #Íæ¼ÒµÚÒ»´Î½øÈëÓÎÏ·³õʼ»¯£¬ÕâÀïÖ»ÔËÐÐÒ»´Î  | 
|     if not curPlayer.GetInitOK():  | 
|         PlayerLoginLoadMapOK(curPlayer, tick)  | 
|           | 
|         #¾ÀÕýÍæ¼ÒÃû×ÖÐÞ¸ÄÊÇ·ñ³É¹¦  | 
|         UpdatePlayerName.PlayerLoadMapRedressUpdatePlayerName(curPlayer, tick)  | 
|       | 
|     #2008.12.21  | 
|     #ÓÉÓÚbug: 2¸öÈËͬʱ½ø¸±±¾, ·Ç¶Ó³¤»á±»Ìß³ö  | 
|     #ÔÒò: ×é¶ÓˢеÄʱ»úÊÇÔÚ¿Í»§¶Ë·¢À´µØÍ¼¶ÁÈ¡³É¹¦µÄʱºò, Õâ¸öʱ»ú¹ýÍí  | 
|     #µ±2¸öÈËͬʱ½øÈëµÄʱºò, µØÍ¼·þÎñÆ÷»¹Ã»ÓÐ×é¶ÓÐÅÏ¢, ËùÒԻᱻÌß  | 
|     #ËùÒÔ°ÑOnPlayerChangeMapʼþ¸Äµ½SetMapIDÖÐ  | 
| #    else:  | 
| #        #¿ªÊ¼µØÍ¼³õʼ»¯¶¯×÷  | 
| #        OnPlayerChangeMap(curPlayer, tick)  | 
|       | 
|     #Íæ¼ÒµØÍ¼¶ÁÈ¡³É¹¦ºó£¬·¢Ë͸øµØÍ¼·þÎñÆ÷³õʼ»¯³É¹¦·â°ü  | 
|     if curPlayer.GetIsLoadMap():  | 
|         #֪ͨµØÍ¼·þÎñÆ÷Íæ¼Ò³õʼ»¯³É¹¦  | 
|         curPlayer.MapServer_GameServerRefreshOK()  | 
|       | 
|     curPlayer.SetIsLoadMap(False)  | 
|       | 
|     #Ö´ÐнûIP²Ù×÷  | 
|     GMCommon.DoLogic_GMForbidIP(curPlayer, tick)  | 
|       | 
|     GameWorld.Log("Íæ¼Ò¿ªÊ¼µØÍ¼³õʼ»¯¶¯×÷" , curPlayer.GetPlayerID())  | 
|     return  | 
|   | 
| #g_worldNotifyTick = 0  | 
| ## ÊÀ½ç֪ͨ  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def WorldNotify(index, tick):  | 
|     #===============================================================================================  | 
|     # global g_worldNotifyTick  | 
|     # if g_worldNotifyTick and tick - g_worldNotifyTick < 3000:  | 
|     #    return  | 
|     # g_worldNotifyTick = tick  | 
|     #===============================================================================================  | 
|     pack = IPY_GameServer.IPY_GWorldNotifyCode()  | 
|     #¹¹½¨ÏµÍ³Ìáʾ²ÎÊýÁÐ±í  | 
|     notifyCodeList = PlayerControl.NotifyCodeList  | 
|     notifyCodeList.Clear()  | 
|       | 
|     for i in range(pack.GetParCount()):  | 
|         notifyMsg = pack.GetPars(i)  | 
|           | 
|         if notifyMsg.GetLen() == 0:  | 
|             #ÊÇÕûÐÍ  | 
|             notifyCodeList.AddInt(notifyMsg.GetMsgInt())  | 
|             #ÊÇ×Ö·û´®  | 
|         else:  | 
|             notifyCodeList.AddStr(notifyMsg.GetMsg())  | 
|       | 
|     familyID = pack.GetFamilyID()  | 
|       | 
|     #¼Ò×å¹ã²¥  | 
|     if familyID != 0:  | 
|         GameWorld.GetPlayerManager().FamilyNotifyCode(familyID, pack.GetMsg(), notifyCodeList)  | 
|         return  | 
|       | 
|     #È«·þ¹ã²¥  | 
|     if pack.GetLineID() <= 0:  | 
|         GameWorld.GetPlayerManager().CountryNotifyCode(pack.GetCountry(), pack.GetMsg(), notifyCodeList)  | 
|         return  | 
|       | 
|     #·ÖÁ÷¹ã²¥ IPY_PlayerManager::LineNotifyCode(int LineNo, char * code, IPY_NotifyCodeList * nofityCode) // ·ÖÁ÷֪ͨ½Ó¿Ú  | 
|     GameWorld.GetPlayerManager().LineNotifyCode(pack.GetRouteIndex(), pack.GetMsg(), notifyCodeList)  | 
|     return  | 
|   | 
|   | 
|   | 
|   | 
|   | 
| #// A0 04 ²éѯ¸±±¾¹¦ÄÜÏß·ÈËÊý #tagCGGetFBLinePlayerCnt  | 
| #  | 
| #struct    tagCGGetFBLinePlayerCnt  | 
| #{  | 
| #    tagHead        Head;  | 
| #    DWORD        MapID;  | 
| #    BYTE        LineCount;  | 
| #    BYTE        LineIDList[LineCount];    //¸öÊýΪ0ʱ´ú±í²éÈ«²¿  | 
| #};  | 
| def ClinetQueryFBLinePlayerCnt(index, clientData, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     queryMapID = clientData.MapID  | 
|     queryFBLineIDList = clientData.LineIDList  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|       | 
|     if queryMapID in ChConfig.Def_CrossMapIDList:  | 
|         fbLinePlayerInfoDict = PyGameData.g_crossFBFuncLinePlayerCountInfo.get(queryMapID, {})  | 
|         if not queryFBLineIDList:  | 
|             resultInfo = [queryMapID, fbLinePlayerInfoDict]  | 
|         else:  | 
|             defaultInfo = [0] # Óë±¾·þ½á¹¹Ïàͬ£¬Ä¬ÈÏ0ÈË  | 
|             queryFBLineInfo = {}  | 
|             for lineID in queryFBLineIDList:  | 
|                 queryFBLineInfo[lineID] = fbLinePlayerInfoDict.get(lineID, defaultInfo)  | 
|             resultInfo = [queryMapID, queryFBLineInfo]  | 
|         QueryFBLinePlayerCntResult(curPlayer, resultInfo)  | 
|         return  | 
|       | 
|     sendCMD = str([queryMapID, queryFBLineIDList])  | 
|     playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), 0, 0, queryMapID,  | 
|                 'FBLinePlayerCnt', sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())  | 
|     return  | 
|   | 
| def QueryFBLinePlayerCntResult(curPlayer, resultInfo):  | 
|     if not curPlayer:  | 
|         return  | 
|     if not resultInfo:  | 
|         return  | 
|     if len(resultInfo) != 2:  | 
|         return  | 
|     tagMapID, fbLinePlayerCntDict = resultInfo  | 
|     fblinePack = ChPyNetSendPack.tagGCFBLinePlayerCnt()  | 
|     fblinePack.MapID = tagMapID  | 
|     fblinePack.FBLineInfoList = []  | 
|     for lineID, infoList in fbLinePlayerCntDict.items():  | 
|         mapLineState = ChPyNetSendPack.tagGCFBLineInfo()  | 
|         mapLineState.Clear()  | 
|         mapLineState.FBLineID = lineID  | 
|         mapLineState.PlayerCnt = infoList[0] if infoList else 0  | 
|         mapLineState.ExtraStr = infoList[1] if len(infoList) > 1 else ''  | 
|         mapLineState.ExtraStrLen = len(mapLineState.ExtraStr)  | 
|         fblinePack.FBLineInfoList.append(mapLineState)  | 
|       | 
|     fblinePack.Count = len(fblinePack.FBLineInfoList)  | 
|     NetPackCommon.SendFakePack(curPlayer, fblinePack)  | 
|     return  | 
|   | 
| #// A0 03 ²éѯµØÍ¼Ïß·״̬ #tagPyGetLineState  | 
| #  | 
| #struct    tagPyGetLineState  | 
| #{  | 
| #    tagHead        Head;  | 
| #    DWORD        MapID;  | 
| #};  | 
| def ClientQueryLineState(index, clientData, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     queryMapID = clientData.MapID # Òª²éѯµÄµØÍ¼£¬0Ϊ²éÈ«²¿  | 
|       | 
|     mapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 1)  | 
|     mapPlayerDict = {}  | 
|     mapServerStateManager = GameWorld.GetGameWorld().GetMapServerStateManager()  | 
|     GetZoneServerCnt = mapServerStateManager.GetZoneServerCnt()  | 
|     for zoneIndex in xrange(GetZoneServerCnt):  | 
|         ZoneServerState = mapServerStateManager.GetZoneServerByIndex(zoneIndex)  | 
|         mapCnt = ZoneServerState.GetMapCount()  | 
|         for i in xrange(mapCnt):  | 
|             MapServerState = ZoneServerState.GetMapServerStateByIndex(i)  | 
|             mapID = MapServerState.GetMapID()  | 
|             if queryMapID > 0 and mapID != queryMapID:  | 
|                 continue  | 
|             lineCnt = MapServerState.GetLineCount()  | 
|             if mapID in mapLineDict:  | 
|                 lineCnt = min(lineCnt, mapLineDict[mapID])  | 
|             curPlayerCntList, maxPlayerCntList = mapPlayerDict.get(mapID, [[], []])  | 
|             for lineIndex in xrange(lineCnt):  | 
|                 MapServerLineState = MapServerState.GetLineByIndex(lineIndex)  | 
|                 #GetMapID = MapServerLineState.GetMapID()  | 
|                 #lineID = MapServerLineState.GetLineID()  | 
|                 curPlayerCnt = MapServerLineState.GetCurPlayerCnt()  | 
|                 maxPlayerCnt = MapServerLineState.GetMaxPlayerCnt()  | 
|                   | 
|                 curPlayerCntList.append(curPlayerCnt)  | 
|                 maxPlayerCntList.append(maxPlayerCnt)  | 
|                   | 
|             mapPlayerDict[mapID] = [curPlayerCntList, maxPlayerCntList]  | 
|             if queryMapID > 0:  | 
|                 break  | 
|       | 
|     # A0 06 ·þÎñÆ÷µØÍ¼Ïß·ÈËÊý״̬ #tagGCPyServerMapState  | 
|     mapStatePack = ChPyNetSendPack.tagGCPyServerMapState()  | 
|     mapStatePack.Clear()  | 
|     mapStatePack.MapStateList = []  | 
|     for mapID, playerCntList in mapPlayerDict.items():  | 
|         mapLineState = ChPyNetSendPack.tagGCPyServerMapLineState()  | 
|         mapLineState.Clear()  | 
|         mapLineState.MapID = mapID  | 
|         mapLineState.LineCurPlayerCntList = playerCntList[0]  | 
|         mapLineState.LineMaxPlayerCntList = playerCntList[1]  | 
|         mapLineState.LineCnt = len(mapLineState.LineCurPlayerCntList)  | 
|         mapStatePack.MapStateList.append(mapLineState)  | 
|     mapStatePack.MapCount = len(mapStatePack.MapStateList)  | 
|     NetPackCommon.SendFakePack(curPlayer, mapStatePack)  | 
|     return  | 
|   | 
| ## µØÍ¼·þÎñÆ÷ÇëÇóÍæ¼ÒÏß·״̬  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def MapServer_GetLineState(index, tick):  | 
| #    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
| #    #curPlayer.Sync_LineState()  | 
| #      | 
| #    mapPlayerDict = {}  | 
| #    mapServerStateManager = GameWorld.GetGameWorld().GetMapServerStateManager()  | 
| #    GetZoneServerCnt = mapServerStateManager.GetZoneServerCnt()  | 
| #    for zoneIndex in xrange(GetZoneServerCnt):  | 
| #        ZoneServerState = mapServerStateManager.GetZoneServerByIndex(zoneIndex)  | 
| #        mapCnt = ZoneServerState.GetMapCount()  | 
| #        for i in xrange(mapCnt):  | 
| #            MapServerState = ZoneServerState.GetMapServerStateByIndex(i)  | 
| #            mapID = MapServerState.GetMapID()  | 
| #            lineCnt = MapServerState.GetLineCount()  | 
| #            curPlayerCntList, maxPlayerCntList = mapPlayerDict.get(mapID, [[], []])  | 
| #            for lineIndex in xrange(lineCnt):  | 
| #                MapServerLineState = MapServerState.GetLineByIndex(lineIndex)  | 
| #                #GetMapID = MapServerLineState.GetMapID()  | 
| #                #lineID = MapServerLineState.GetLineID()  | 
| #                curPlayerCnt = MapServerLineState.GetCurPlayerCnt()  | 
| #                maxPlayerCnt = MapServerLineState.GetMaxPlayerCnt()  | 
| #                  | 
| #                curPlayerCntList.append(curPlayerCnt)  | 
| #                maxPlayerCntList.append(maxPlayerCnt)  | 
| #                  | 
| #            mapPlayerDict[mapID] = [curPlayerCntList, maxPlayerCntList]  | 
| #      | 
| #    # A0 06 ·þÎñÆ÷µØÍ¼Ïß·ÈËÊý״̬ #tagGCPyServerMapState  | 
| #    mapStatePack = ChPyNetSendPack.tagGCPyServerMapState()  | 
| #    mapStatePack.Clear()  | 
| #    mapStatePack.MapStateList = []  | 
| #    for mapID, playerCntList in mapPlayerDict.items():  | 
| #        mapLineState = ChPyNetSendPack.tagGCPyServerMapLineState()  | 
| #        mapLineState.Clear()  | 
| #        mapLineState.MapID = mapID  | 
| #        mapLineState.LineCurPlayerCntList = playerCntList[0]  | 
| #        mapLineState.LineMaxPlayerCntList = playerCntList[1]  | 
| #        mapLineState.LineCnt = len(mapLineState.LineCurPlayerCntList)  | 
| #        mapStatePack.MapStateList.append(mapLineState)  | 
| #    mapStatePack.MapCount = len(mapStatePack.MapStateList)  | 
| #    NetPackCommon.SendFakePack(curPlayer, mapStatePack)  | 
|     return  | 
|   | 
| ## ²é¿´FBÏÔʾ½çÃæ  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def ShowFbEvent(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     if tick - curPlayer.GetDictByKey("ShowFbEvent") < ChConfig.Def_Show_Fb_Event_Tick:  | 
|         return  | 
|       | 
|     curPlayer.Sync_GameFbEvent()  | 
|     curPlayer.SetDict("ShowFbEvent", tick)  | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # //03 24 ¾Ù±¨#tagCImpeach  | 
| # tagCImpeach       *   GettagCImpeach();  | 
| #   | 
| # class   IPY_CImpeach  | 
| # {  | 
| # public:  | 
| #   | 
| #    int      GetPlayerID();  | 
| #   | 
| #    int      GetMsgLen();  | 
| #    //size = MsgLen  | 
| #    char *      GetMsg();  | 
| #   | 
| #    int      GetTalkLen();  | 
| #    //size = TalkLen  | 
| #    char *      GetTalk();  | 
| # };  | 
| #===============================================================================  | 
| ## ¾Ù±¨Íæ¼Ò  | 
| #  @param index Íæ¼ÒË÷Òý   | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return True  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Impeach(index , tick):  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|     curPlayer = playerManager.GetPlayerByIndex(index)  | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|       | 
|     if tick - gameWorld.GetTickByType(ChConfig.TYPE_ImpeachTick) < ChConfig.TYPE_Tick_Time[ChConfig.TYPE_ImpeachTick]:  | 
|         #Speech_Lost_Frequently ¶Ô²»Æð£¬ÄúµÄ¾Ù±¨²Ù×÷¹ýÓÚÆµ·±£¬ÇëÉÔºóÖØÊÔ  | 
|         PlayerControl.NotifyCode(curPlayer, "Speech_Lost_Frequently")  | 
|         return  | 
|       | 
|     gameWorld.SetTickByType(ChConfig.TYPE_ImpeachTick , tick)  | 
|       | 
|     pack = IPY_GameServer.IPY_CImpeach()  | 
|     tagPlayer = playerManager.FindPlayerByID(pack.GetPlayerID())  | 
|       | 
|     if not tagPlayer:  | 
|         #Speech_Lost_NoLine ¶Ô²»Æð£¬Äú¾Ù±¨µÄÍæ¼Ò²»ÔÚÏߣ¬ÇëÉÔºóÖØÊÔ  | 
|         PlayerControl.NotifyCode(curPlayer, "Speech_Lost_NoLine")  | 
|         return  | 
|       | 
|     curPlayer.ImpeachPlayer(tagPlayer, str(pack.GetTalk()))  | 
|     #Speech_Success ×¢Ò⣺ÄúµÄ¾Ù±¨²Ù×÷ÒѾ³É¹¦  | 
|     PlayerControl.NotifyCode(curPlayer, "Speech_Success")  | 
|     return  | 
| #---------------------------------------------------------------------  | 
|   | 
| ## Í¬²½Ê±¼ä  | 
| #  @param index Íæ¼ÒʵÀý  | 
| #  @param clientData ·â°ü½á¹¹Ìå  | 
| #  @param tick Ê±¼ä´Á  | 
| #  @return None  | 
| def ClientRequestServerTime(index, clientData, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     Sync_PyServerDataTimeToClient(curPlayer, tick)  | 
|     return  | 
|   | 
|   | 
| ## Í¬²½Ê±¼ä  | 
| #  @param curPlayer   | 
| #  @param tick Ê±¼ä´Á  | 
| #  @return None  | 
| def Sync_PyServerDataTimeToClient(curPlayer, tick):  | 
|   | 
|     if not GameWorld.RefurbishPlayerTick(curPlayer, ChConfig.TYPE_Player_Tick_SyncClientTick, tick):  | 
|         #¼ä¸ôδµ½  | 
|         return  | 
|       | 
|     # ·þÎñÆ÷ʱ¼ä  | 
|     serverTime = GameWorld.GetServerTime()  | 
|     if not serverTime:  | 
|         return  | 
|       | 
|     serverDateTime = ChPyNetSendPack.tagServerDateTime()  | 
|     serverDateTime.Clear()  | 
|     serverDateTime.Year = serverTime.year  | 
|     serverDateTime.Month = serverTime.month  | 
|     serverDateTime.Day = serverTime.day  | 
|     serverDateTime.Hour = serverTime.hour  | 
|     serverDateTime.Minute = serverTime.minute  | 
|     serverDateTime.Second = serverTime.second  | 
|     serverDateTime.MicSecond = serverTime.microsecond  | 
|     serverDateTime.CrossServerTime = GameWorld.GetCrossServerTimeStr()  | 
|       | 
|     # Í¨Öª¿Í»§¶Ëͬ²½Ê±¼ä  | 
|     NetPackCommon.SendFakePack(curPlayer, serverDateTime)  | 
|     return  | 
|   | 
| def UpdataPlayerLVInfo():  | 
|     #Onday¸üÐÂÍæ¼ÒµÈ¼¶ÐÅÏ¢  | 
|     PyGameData.g_yesterdayPlayerLVDict = PyGameData.g_todayPlayerLVDict  | 
|     PyGameData.g_todayPlayerLVDict = {}  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|     for i in xrange(playerManager.GetActivePlayerCount()):  | 
|         curPlayer = playerManager.GetActivePlayerAt(i)  | 
|         if curPlayer == None or not curPlayer.GetInitOK():  | 
|             continue  | 
|         if PlayerControl.GetIsTJG(curPlayer):  | 
|             continue  | 
|         PyGameData.g_todayPlayerLVDict[curPlayer.GetID()] = curPlayer.GetLV()  | 
|     return  | 
|   | 
| def LoadPlayerLVData():  | 
|     #·þÎñÆ÷¿ªÆôʱ¼ÓÔØ»îÔ¾Íæ¼ÒµÈ¼¶ÐÅÏ¢  | 
|     universalRecMgr = GameWorld.GetUniversalRecMgr()  | 
|   | 
|     recDataList = universalRecMgr.GetTypeList(ShareDefine.Def_UniversalGameRecType_TodayPlayerLVInfo)  | 
|     allCnt = recDataList.Count()  | 
|     for index in xrange(allCnt):  | 
|         recData = recDataList.At(index)  | 
|         PyGameData.g_todayPlayerLVDict[recData.GetValue1()] = recData.GetValue2()  | 
|       | 
|     recDataList = universalRecMgr.GetTypeList(ShareDefine.Def_UniversalGameRecType_YesterdayPlayerLVInfo)  | 
|     allCnt = recDataList.Count()  | 
|     for index in xrange(allCnt):  | 
|         recData = recDataList.At(index)  | 
|         PyGameData.g_yesterdayPlayerLVDict[recData.GetValue1()] = recData.GetValue2()  | 
|     GameWorld.DebugLog('    ·þÎñÆ÷¿ªÆôʱ¼ÓÔØ»îÔ¾Íæ¼ÒµÈ¼¶ÐÅÏ¢g_todayPlayerLVDict=%s, g_yesterdayPlayerLVDict=%s'%(PyGameData.g_todayPlayerLVDict,PyGameData.g_yesterdayPlayerLVDict))  | 
|     return  | 
|   | 
| def SavePlayerLVData():  | 
|     #·þÎñÆ÷¹Ø±Õǰʱ±£´æ»îÔ¾Íæ¼ÒµÈ¼¶ÐÅÏ¢  | 
|     GameWorld.GetUniversalRecMgr().Delete(ShareDefine.Def_UniversalGameRecType_TodayPlayerLVInfo)  | 
|     GameWorld.GetUniversalRecMgr().Delete(ShareDefine.Def_UniversalGameRecType_YesterdayPlayerLVInfo)  | 
|     universalRecMgr = GameWorld.GetUniversalRecMgr()  | 
|     recDataList = universalRecMgr.GetTypeList(ShareDefine.Def_UniversalGameRecType_TodayPlayerLVInfo)  | 
|     for playerID, lv in PyGameData.g_todayPlayerLVDict.items():  | 
|         recData = recDataList.AddRec()  | 
|         recData.SetValue1(playerID)  | 
|         recData.SetValue2(lv)  | 
|       | 
|     recDataList = universalRecMgr.GetTypeList(ShareDefine.Def_UniversalGameRecType_YesterdayPlayerLVInfo)  | 
|     for playerID, lv in PyGameData.g_yesterdayPlayerLVDict.items():  | 
|         recData = recDataList.AddRec()  | 
|         recData.SetValue1(playerID)  | 
|         recData.SetValue2(lv)  | 
|     return |