| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package PlayerBillboard  | 
| #  | 
| # @todo:ÅÅÐаñ  | 
| # @author hxp  | 
| # @date 2018-03-06  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ÅÅÐаñ  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2018-03-06 11:00"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
|   | 
| import IPY_GameServer  | 
| import GameWorld  | 
| import ChConfig  | 
| import ShareDefine  | 
| import PlayerControl  | 
| import ChPyNetSendPack  | 
| import PlayerDBGSEvent  | 
| import NetPackCommon  | 
| import DataRecordPack  | 
| import PlayerFamily  | 
| import PyDataManager  | 
| import PlayerViewCache  | 
| import IpyGameDataPY  | 
|   | 
| import time  | 
| import random  | 
|   | 
| Def_Key_BillboardSortTick = "BillboardSortTick_%s" # ÅÅÐаñÊÇ·ñÅÅÐòtick£¬²ÎÊý£¨ÅÅÐаñÀàÐÍ£©  | 
| Def_Key_BillboardNeedSort = "BillboardNeedSort_%s" # ÅÅÐаñÊÇ·ñÐèÒªÅÅÐò£¬²ÎÊý£¨ÅÅÐаñÀàÐÍ£©  | 
|   | 
| #ÐèҪÿÌ쿽±´×òÈÕ°ñµ¥µÄÅÅÐаñÀàÐÍ×Öµä  | 
| Def_NeedCopyYesterday_Dict = {  | 
|     #×òÈÕ°ñ£¨¿½±´£©                                    #½ñÈÕ°ñ£¨Ô´Êý¾Ý£©  | 
|                          }  | 
|   | 
| def NoteOssBillboardInfoByDay():  | 
|     ## Ã¿Ìì¼Ç¼ÅÅÐаñÐÅÏ¢µ½ossÖÐ  | 
|     Def_NoteOssBillboardTypeList = IpyGameDataPY.GetFuncEvalCfg("BillboardSet", 1)  | 
|     for billboardType in Def_NoteOssBillboardTypeList:  | 
|         DataRecordPack.DR_BillboardDataByDay(billboardType)  | 
|     return  | 
|   | 
| def CopyBillboardOnDay():  | 
|     ## Ã¿Ì쿽±´Ð¾ÉÅÅÐаñÊý¾Ý  | 
|       | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|     for billboardType in ShareDefine.BillboardTypeList:  | 
|         if not gameWorld.GetDictByKey(Def_Key_BillboardNeedSort % billboardType):  | 
|             continue  | 
|         gameWorld.SetDict(Def_Key_BillboardNeedSort % billboardType, 0)  | 
|         GameWorld.Log("OnDay SortBillboardByIndex %s" % billboardType)  | 
|         SortBillboardByIndex(billboardType)  | 
|           | 
|     for billboardTypeYesterday, billboardType  in Def_NeedCopyYesterday_Dict.items():  | 
|         CopyBillboard(billboardTypeYesterday, billboardType)  | 
|     return  | 
|   | 
| def InitServerBillboard():  | 
|     ##³õʼ»¯ËùÓÐÅÅÐаñ  | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|       | 
|     for index in xrange(ShareDefine.Def_BT_Max):  | 
|         billBoard = billboardMgr.AddBillboard(index)  | 
|         #ÉèÖÃ×î´óÊýÁ¿  | 
|         billBoard.SetMaxCount(ChConfig.Def_BT_Cnt.get(index, 10))  | 
|         #ÉèÖñ£´æÀàÐÍ  | 
|         billBoard.SetSaveToDB(ChConfig.Def_BT_SaveType.get(index, ChConfig.Def_BT_SaveType_SaveDB))  | 
|           | 
|     return  | 
|   | 
| def __CheckFightPowerBillboard():  | 
|     ## ÓÉÓÚÕ½Á¦ÐÞ¸ÄΪ֧³Ö³¬¹ý20E£¬ËùÒÔÐèÒª´¦ÀíÏÂÕ½Á¦Ïà¹Ø°ñµ¥£¬Ô cmpValue ÖµÒƶ¯µ½ cmpValue2  | 
|       | 
|     eventKey = "FightPowerBillboardMoveValue"  | 
|     if PlayerDBGSEvent.GetDBGSTrig_ByKey(eventKey):  | 
|         return  | 
|     PlayerDBGSEvent.SetDBGSTrig_ByKey(eventKey, 1)  | 
|     GameWorld.Log("´¦ÀíÕ½Á¦°ñ³¬¹ý20EÖ§³Ö£¡")  | 
|       | 
|     billboardList = [ShareDefine.Def_BT_FightPower] + ShareDefine.JobFightPowerBillboardDict.values()  | 
|     for billboardType in billboardList:  | 
|         billboard = GameWorld.GetBillboard().FindBillboard(billboardType)  | 
|         if not billboard:  | 
|             continue  | 
|         GameWorld.Log("    billboardType=%s,count=%s" % (billboardType, billboard.GetCount()))  | 
|         for index in xrange(billboard.GetCount()):  | 
|             billBoardData = billboard.At(index)  | 
|             if not billBoardData:  | 
|                 continue  | 
|             billBoardData.SetCmpValue2(billBoardData.GetCmpValue())  | 
|             billBoardData.SetCmpValue(0)  | 
|               | 
|     return  | 
|   | 
| def SortServerBillboard():  | 
|     ##ÅÅÐòËùÓÐÅÅÐаñ  | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|       | 
|     for index in range(0, billboardMgr.GetCount()):  | 
|         billBoard = billboardMgr.FindBillboard(index)  | 
|         #ÅÅÐòÒ»´ÎÅÅÐаñ  | 
|         billBoard.Sort()  | 
|           | 
|     __CheckFightPowerBillboard()  | 
|     return  | 
|   | 
| def CopyBillboard(newBillboardIndex, oldBillboardIndex):  | 
|     ## ÔÑù¿½±´ÅÅÐаñ  | 
|     #  @param newBillboardIndex: Ð°ñË÷Òý  | 
|     #  @param oldBillboardIndex: ¾É°ñË÷Òý  | 
|     #  @return: boolÖµ  | 
|     #¾É°ñÅÅÐÐ  | 
|     oldBillBoard = GameWorld.GetBillboard().FindBillboard(oldBillboardIndex)  | 
|     if not oldBillBoard:  | 
|         return False  | 
|       | 
|     #Çå¿ÕаñÊý¾Ý  | 
|     ClearBillboardByIndex(newBillboardIndex)  | 
|       | 
|     for index in range(0, oldBillBoard.GetCount()):  | 
|           | 
|         oldBillBoardData = oldBillBoard.At(index)  | 
|         if not oldBillBoardData:  | 
|             continue  | 
|           | 
|         id = oldBillBoardData.GetID()  | 
|         id2 = oldBillBoardData.GetID2()  | 
|         name1 = oldBillBoardData.GetName1()  | 
|         name2 = oldBillBoardData.GetName2()  | 
|         type2 = oldBillBoardData.GetType2()  | 
|         value1 = oldBillBoardData.GetValue1()  | 
|         value2 = oldBillBoardData.GetValue2()  | 
|         cmpValue = oldBillBoardData.GetCmpValue()  | 
|         cmpValue2 = oldBillBoardData.GetCmpValue2()  | 
|         cmpValue3 = oldBillBoardData.GetCmpValue3()  | 
|   | 
|         #---»ñÈ¡ÅÅÐаñÐÅÏ¢---  | 
|         billBoard, billBoardData = GetBillBoardData(newBillboardIndex, id, cmpValue)  | 
|         if billBoard == None or billBoardData == None:  | 
|             #ÎÞ·¨Éϰñ  | 
|             continue  | 
|       | 
|         #ÉèÖÃÅÅÐаñÊý¾Ý  | 
|         billBoardData.SetType(newBillboardIndex)  | 
|         billBoardData.SetID(id)  | 
|         billBoardData.SetID2(id2)  | 
|         billBoardData.SetName1(name1)  | 
|         billBoardData.SetName2(name2)  | 
|         billBoardData.SetType2(type2)  | 
|         billBoardData.SetValue1(value1)  | 
|         billBoardData.SetValue2(value2)  | 
|         billBoardData.SetCmpValue(cmpValue)  | 
|         billBoardData.SetCmpValue2(cmpValue2)  | 
|         billBoardData.SetCmpValue3(cmpValue3)  | 
|           | 
|     GameWorld.Log("    CopyBillboard newBillboardIndex=%s, oldBillboardIndex=%s" % (newBillboardIndex, oldBillboardIndex))  | 
|   | 
|     return True  | 
|   | 
| def ClearBillboardByIndex(billboardIndex):  | 
|     ##Çå¿ÕÅÅÐаñ  | 
|     billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)  | 
|       | 
|     if not billBoard:  | 
|         GameWorld.ErrLog('ClearBillboardByIndex FindBillboardErr, ÅÅÐаñ = %s ÎÞ·¨²éÕÒ'%(billboardIndex))  | 
|         return  | 
|       | 
|     billBoard.Clear()  | 
|       | 
|     GameWorld.Log('billboardIndex %s clear.'%billboardIndex)  | 
|     return  | 
|   | 
| def UpdateBillboardMaxCount(billboardIndex, updMaxCount, isDelExtra=True):  | 
|     ''' ±ä¸ü¾º¼¼³¡°ñµ¥×î´óÊý¾ÝÊý  | 
|     @param updMaxCount: ¸üеÄ×î´óÊý¾ÝÅÅÃû  | 
|     @param isDelExtra: ÊÇ·ñɾ³ýÔ°ñµ¥ÅÅÃûÊý¾Ý³¬¹ý¸üкóµÄ×î´óÅÅÃû£¬Ä¬ÈÏɾ³ý  | 
|     '''  | 
|     billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)  | 
|     if not billBoard:  | 
|         return  | 
|     curCount = billBoard.GetCount()  | 
|     curMaxCount = billBoard.GetMaxCount()  | 
|     # ²»³¬¹ý³ÌÐòÄÚÖÃÅäÖõÄ×î´óÊýÁ¿  | 
|     if billboardIndex in ChConfig.Def_BT_Cnt:  | 
|         updMaxCount = min(updMaxCount, ChConfig.Def_BT_Cnt[billboardIndex])  | 
|     if curMaxCount == updMaxCount:  | 
|         return  | 
|     billBoard.SetMaxCount(updMaxCount)  | 
|     GameWorld.Log("    ±ä¸ü°ñµ¥×î´óÊý¾ÝÊý! billboardIndex=%s,curCount=%s,curMaxCount=%s,updMaxCount=%s"   | 
|                   % (billboardIndex, curCount, curMaxCount, updMaxCount))  | 
|       | 
|     # Çå³ý¶àÓà°ñµ¥Êý¾Ý  | 
|     if isDelExtra and curCount > updMaxCount:  | 
|         for delIndex in xrange(curCount - 1, updMaxCount - 1, -1):  | 
|             if delIndex >= 0:  | 
|                 GameWorld.Log("        DeleteByIndex: %s" % delIndex)  | 
|                 billBoard.DeleteByIndex(delIndex)  | 
|     return  | 
|   | 
| ####################################################################################################  | 
|   | 
| #class   IPY_GSetWatchBillboardState  | 
| #{  | 
| #public:  | 
| #  | 
| #    int      GetState();  | 
| #};  | 
| ## mapÇëÇóÍæ¼ÒÉèÖò鿴ÅÅÐаñ״̬  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def MapServer_PlayerSetWatchBillboardState(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameServer.IPY_GSetWatchBillboardState()  | 
|     curPlayer.SetPlayerWatchBillboardState(pack.GetState())  | 
|     return  | 
|   | 
| #class   IPY_GWatchBillboard  | 
| #{  | 
| #public:  | 
| #  | 
| #    int      GetType();  | 
| #};  | 
| ## mapÇëÇóÍæ¼Ò²é¿´ÅÅÐаñ״̬  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def MapServer_PlayerWatchBillboard(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameServer.IPY_GWatchBillboard()  | 
|     curPlayer.Sync_Billboard(pack.GetType())  | 
|     return  | 
|   | 
| #//////////////////////////////////////////////////////////////  | 
| #//10 01 ²é¿´ÅÅÐаñ#tagCWatchBillboard  | 
| #tagCWatchBillboard       *   GettagCWatchBillboard();  | 
| #  | 
| #class   IPY_CWatchBillboard  | 
| #{  | 
| #public:  | 
| #    //ÀàÐÍ TBillboardType  | 
| #    int      GetType();  | 
| #};  | 
| ## ²é¿´Íæ¼ÒÅÅÐаñ  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def WatchPlayerBillboard(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameServer.IPY_CWatchBillboard()  | 
|     packType = pack.GetType()  | 
|       | 
|     if packType < 0 or packType >= ShareDefine.Def_BT_Max:  | 
|         return  | 
|   | 
|     if packType in ChConfig.Def_InterdictLook_BT_Type:  | 
|         #²»¿Éͨ¹ý´Ë·â°ü²é¿´  | 
|         return  | 
|     if ChConfig.Def_BT_Cnt.get(packType, 0) > 100:  | 
|         GameWorld.DebugLog("¸Ã°ñµ¥×î´óÃû´Î½Ï´ó£¬ÐèʹÓ÷ÖÒ³²éѯ! A9 A2 ²é¿´ÅÅÐаñ#tagCPYWatchBillboard")  | 
|         return  | 
|     if not __CheckWatchCD(curPlayer, packType, tick):  | 
|         return  | 
|       | 
|     if GameWorld.GetGameWorld().GetDictByKey(Def_Key_BillboardNeedSort % packType):  | 
|         GameWorld.GetGameWorld().SetDict(Def_Key_BillboardNeedSort % packType, 0)  | 
|         #GameWorld.DebugLog("Íæ¼Ò²é¿´ÅÅÐаñ£¬Ç¿ÖÆÅÅÐò£¡packType=%s" % (packType))  | 
|         SortBillboardByIndex(packType)  | 
|           | 
|     curPlayer.Sync_Billboard(packType)  | 
| #    GameWorld.Log('packType1111=%s'%packType)  | 
|     return  | 
|   | 
| def __CheckWatchCD(curPlayer, billboardType, tick):  | 
|     ##¼ì²é²é¿´ÅÅÐаñCD ¸ù¾ÝÅÅÐаñÀàÐͶÀÁ¢CD  | 
|     dictKey = "WatchRankTick_%s"%billboardType  | 
|     lastTick = curPlayer.GetDictByKey(dictKey)  | 
|       | 
|     #µÚÒ»´Î¼Ç¼  | 
|     if not lastTick:  | 
|         curPlayer.SetDict(dictKey, tick)  | 
|         return True  | 
|       | 
|     #¼ä¸ôδµ½  | 
|     if tick - lastTick < ChConfig.Def_PlayerBillboard_Tick:  | 
|         #ʱ¼äδµ½  | 
|         return False  | 
|       | 
|     curPlayer.SetDict(dictKey, tick)  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # //10 02 ½±Àø°ñÊý¾Ý#tagCWatchBillboardPrize  | 
| # tagCWatchBillboardPrize       *   GettagCWatchBillboardPrize();  | 
| #   | 
| # class   IPY_CWatchBillboardPrize  | 
| # {  | 
| # public:  | 
| #    //ÀàÐÍ TBillboardType  | 
| #    int      GetType();  | 
| # };  | 
| #===============================================================================  | 
| ## ½±Àø°ñÊý¾Ý  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def WatchBillboardPrize(index, tick):  | 
|     #´Ë½Ó¿Ú·ÏÆú  | 
|     return  | 
| #===============================================================================  | 
| #    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
| #    pack = IPY_GameServer.IPY_CWatchBillboardPrize()  | 
| #    packType = pack.GetType()  | 
| #      | 
| #    if packType < IPY_GameServer.btLV or packType >= IPY_GameServer.btMax:  | 
| #        return  | 
| #      | 
| #    gameWorld = GameWorld.GetGameWorld()  | 
| #      | 
| #    if tick - gameWorld.GetTickByType(ChConfig.TYPE_WatchBillboardPrize) < ChConfig.TYPE_Tick_Time[ChConfig.TYPE_WatchBillboardPrize]:  | 
| #        return  | 
| #      | 
| #    gameWorld.SetTickByType(ChConfig.TYPE_WatchBillboardPrize , tick)  | 
| #    #Í¨ÖªÍæ¼Ò½±Àø°ñÐÅÏ¢  | 
| #    curPlayer.Sync_BillboardPrize(packType)  | 
| #===============================================================================  | 
| #---------------------------------------------------------------------  | 
| ##ÅÅÐòÅÅÐаñ, Í¨¹ýÅÅÐаñË÷Òý  | 
| # @param billboardIndex ÅÅÐаñË÷Òý  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks   | 
| def SortBillboardByIndex(billboardIndex):  | 
|     billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)  | 
|       | 
|     if not billBoard:  | 
|         GameWorld.ErrLog('SortBillboardByIndex, ÅÅÐаñ = %s ÎÞ·¨²éÕÒ'%(billboardIndex))  | 
|         return  | 
|       | 
|     billBoard.Sort()  | 
|     return  | 
|   | 
| #// A9 A2 ²é¿´ÅÅÐаñ#tagCPYWatchBillboard  | 
| #  | 
| #struct    tagCPYWatchBillboard  | 
| #{  | 
| #    tagHead        Head;  | 
| #    BYTE        Type;        //ÀàÐÍ TBillboardType  | 
| #    DWORD        StartIndex;    //²é¿´µÄÆðʼÃû´ÎË÷Òý£¬ Ä¬ÈÏ0  | 
| #    BYTE        WatchCnt;    //²é¿´ÌõÊý£¬Ä¬ÈÏ20£¬×î´ó²»³¬¹ý100  | 
| #    BYTE        IsWatchSelf;    //ÊÇ·ñ²é¿´×Ô¼ºÃû´Îǰºó£¬Ä¬ÈÏ10ÌõÊý¾Ý  | 
| #};  | 
| def Client_PYWatchBillboard(index, clientData, tick):  | 
|       | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     if not curPlayer:  | 
|         return  | 
|       | 
|     packType = clientData.Type  | 
|     startIndex = clientData.StartIndex  | 
|     watchCnt = clientData.WatchCnt  | 
|     isWatchSelf = clientData.IsWatchSelf  | 
|     if not __CheckWatchCD(curPlayer, packType, tick):  | 
|         return  | 
|       | 
|     Sync_BillboardEx(curPlayer, packType, isWatchSelf, startIndex, watchCnt)  | 
|     return  | 
|   | 
| def Sync_BillboardEx(curPlayer, bbType, isWatchSelf=False, startIndex=0, watchCnt=20):  | 
|     if bbType < 0 or bbType >= ShareDefine.Def_BT_Max:  | 
|         return  | 
|       | 
|     billBoard = GameWorld.GetBillboard().FindBillboard(bbType)  | 
|     if not billBoard:  | 
|         GameWorld.ErrLog("ÕÒ²»µ½ÅÅÐаñÊý¾Ý£¡bbType=%s" % (bbType))  | 
|         return  | 
|       | 
|     playerID = curPlayer.GetPlayerID()  | 
|     count = billBoard.GetCount()  | 
|     endIndex = 0  | 
|     # ²é¿´×Ô¼ºÇ°ºóÃû´Î  | 
|     if isWatchSelf:  | 
|         playerIndex = billBoard.IndexOfByID(playerID)  | 
|         if playerIndex != -1:  | 
|             # Ç°5ºó4£¬Ê×β²¹×ã10Ìõ¼Ç¼  | 
|             endIndex = min(playerIndex + 5, count)  | 
|             startIndex = max(0, endIndex - 10)  | 
|             endIndex = min(endIndex + (10 - (endIndex - startIndex)), count)  | 
|         else:  | 
|             startIndex = 0  | 
|               | 
|     # Ö¸¶¨Ë÷Òý·ÖÒ³²é¿´  | 
|     else:  | 
|         startIndex = max(startIndex, 0)  | 
|         startIndex = min(startIndex, count)  | 
|         watchCnt = 20 if not watchCnt else min(watchCnt, 100) # Ä¬ÈÏ20£¬×î¶à100  | 
|         endIndex = min(startIndex + watchCnt, count)  | 
|           | 
|     billBoardData = ChPyNetSendPack.tagPYBillboardData()  | 
|     billBoardData.Clear()  | 
|     billBoardData.IsWatchSelf = isWatchSelf  | 
|     billBoardData.Type = bbType  | 
|     billBoardData.Billboard = []      | 
|     for index in xrange(startIndex, endIndex):  | 
|           | 
|         if startIndex < 0 or index >= count:  | 
|             break  | 
|           | 
|         bbData = billBoard.At(index)  | 
|           | 
|         bbInfo = ChPyNetSendPack.tagPYBillboardInfo()  | 
|         bbInfo.Clear()  | 
|         bbInfo.OrderIndex = index  | 
|         bbInfo.ID = bbData.GetID()  | 
|         bbInfo.ID2 = bbData.GetID2()  | 
|         bbInfo.Name1 = bbData.GetName1()  | 
|         bbInfo.Name2 = bbData.GetName2()  | 
|         bbInfo.Type2 = bbData.GetType2()  | 
|         bbInfo.Value1 = bbData.GetValue1()  | 
|         bbInfo.Value2 = bbData.GetValue2()  | 
|         bbInfo.CmpValue = bbData.GetCmpValue()  | 
|         bbInfo.CmpValue2 = bbData.GetCmpValue2()  | 
|         bbInfo.CmpValue3 = bbData.GetCmpValue3()  | 
|           | 
|         billBoardData.Billboard.append(bbInfo)  | 
|           | 
|     billBoardData.BillboardCount = len(billBoardData.Billboard)  | 
|     NetPackCommon.SendFakePack(curPlayer, billBoardData)  | 
|     return  | 
|   | 
| #===============================================================================  | 
| def MapServer_UpdateBillboard(billInfoDict, tick):  | 
|     '''µØÍ¼¸üÐÂÅÅÐаñ, Í¨Óà  | 
|     {"Type":bType, "Type2":bType2, "ID":bID, "ID2":bID2, "Name1":bName, "Name2":bName2, "ExInfo":exInfo,  | 
|     "Value1":value1, "Value2":value2, "CmpValue":cmpValue, "CmpValue2":cmpValue2, "CmpValue3":cmpValue3, "autoSort":autoSort}  | 
|     '''  | 
|       | 
|     bType = billInfoDict["Type"]  | 
|     bType2 = billInfoDict["Type2"]  | 
|     bID = billInfoDict["ID"]  | 
|     #bID2 = billInfoDict["ID2"]  | 
|     bName = billInfoDict["Name1"]  | 
|     bName2 = billInfoDict["Name2"]  | 
|     value1 = billInfoDict["Value1"]  | 
|     value2 = billInfoDict["Value2"]  | 
|     cmpValue = billInfoDict["CmpValue"]  | 
|     cmpValue2 = billInfoDict["CmpValue2"]  | 
|     cmpValue3 = billInfoDict["CmpValue3"]  | 
|     if bType not in ShareDefine.BillboardTypeList:  | 
|         return  | 
|     #if not cmpValue and not cmpValue2 and not cmpValue3:  | 
|     #    return  | 
|       | 
|     #ɾ³ý¸ÃÊý¾Ý  | 
|     if cmpValue == -1:  | 
|         billboardMgr = GameWorld.GetBillboard()  | 
|         playerBillBoard = billboardMgr.FindBillboard(bType)  | 
|         if not playerBillBoard:  | 
|             return  | 
|         if playerBillBoard.FindByID(bID):  | 
|             playerBillBoard.DeleteByID(bID)  | 
|             playerBillBoard.Sort()  | 
|             GameWorld.DebugLog("ɾ³ýÅÅÐаñijÌõÊý¾Ý: bType=%s,bID=%s" % (bType, bID))  | 
|         return  | 
|       | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|     lastSortTick = gameWorld.GetDictByKey(Def_Key_BillboardSortTick % bType)  | 
|     autoSort = (tick - lastSortTick) >= 60000 or billInfoDict.get("autoSort") == True # 1·ÖÖÓÇ¿ÖÆÅÅÐòÒ»´Î  | 
|     if autoSort:  | 
|         gameWorld.SetDict(Def_Key_BillboardSortTick % bType, tick)  | 
|     #GameWorld.DebugLog("¸üÐÂÅÅÐаñ£ºbType=%s,autoSort=%s,tick=%s,lastSortTick=%s,d=%s" % (bType, autoSort, tick, lastSortTick, tick - lastSortTick))  | 
|       | 
|     UpdatePlayerBillboard(bID, bName, bName2, bType, bType2, value1, value2, cmpValue, autoSort, cmpValue2, cmpValue3)  | 
|       | 
|     exInfo = billInfoDict["ExInfo"]  | 
|     # ÒÔÏÂΪ°ñµ¥¸½¼ÓÌØÊâ´¦Àí  | 
|     if bType == ShareDefine.Def_BT_FightPower:  | 
|         playerID = bID  | 
|         fightPowerTotal = cmpValue * ChConfig.Def_PerPointValue + cmpValue2  | 
|         familyID = exInfo[0]  | 
|         playerJob = bType2  | 
|           | 
|         curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)  | 
|         if curPlayer:  | 
|             PlayerControl.SetFightPower(curPlayer, fightPowerTotal)  | 
|               | 
|         #¸üÐÂÕ½Ã˳ÉÔ±Õ½Á¦  | 
|         PlayerFamily.UpdFamilyMemberFightPower(familyID, playerID, fightPowerTotal)  | 
|           | 
|         #Ö°ÒµÕ½Á¦°ñ  | 
|         job = playerJob % 10  | 
|         if job in ShareDefine.JobFightPowerBillboardDict:  | 
|             jobBType = ShareDefine.JobFightPowerBillboardDict[job]  | 
|             UpdatePlayerBillboard(bID, bName, bName2, jobBType, bType2, value1, value2, cmpValue, autoSort, cmpValue2)  | 
|               | 
|     return  | 
|   | 
| def DelJobFightPowerBillboard(curPlayer, delJob):  | 
|     ## É¾³ýÍæ¼Ò¶ÔÓ¦Ö°ÒµÕ½Á¦°ñ  - Ò»°ãÊÇÍæ¼ÒÖ°Òµ¸Ä±äÁË£¬ÐèҪɾ³ý¾ÉÖ°ÒµµÄÖ°ÒµÕ½Á¦°ñµ¥  | 
|     if delJob not in ShareDefine.JobFightPowerBillboardDict:  | 
|         return  | 
|     jobBType = ShareDefine.JobFightPowerBillboardDict[delJob]  | 
|     playerID = curPlayer.GetPlayerID()  | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|     playerBillBoard = billboardMgr.FindBillboard(jobBType)  | 
|     if not playerBillBoard:  | 
|         return  | 
|     if playerBillBoard.FindByID(playerID):  | 
|         playerBillBoard.DeleteByID(playerID)  | 
|         GameWorld.DebugLog("ɾ³ýÍæ¼ÒÖ°ÒµÕ½Á¦°ñµ¥: delJob=%s,jobBType=%s" % (delJob, jobBType), playerID)  | 
|     return  | 
|   | 
| def GetBillboardOperateInfo(curPlayer):  | 
|     # ÅÅÐаñÖÐËù±£´æµÄÔËÓªÉÌÏà¹ØÐÅÏ¢  | 
|     return curPlayer.GetFace()  | 
| #    platform = curPlayer.GetAccID()  | 
| #    if platform in ["tencent"]:  | 
| #        return curPlayer.GetOperateInfo()  | 
| #    return platform  | 
|   | 
| def UpdatePlayerBillboardEx(curPlayer, playerID, bType, cmpValue, cmpValue2=0, cmpValue3=0, value1=0, value2=0, autoSort=False):  | 
|     ## ¸üÐÂÍæ¼ÒÅÅÐаñ  | 
|     # @param curPlayer: ¿ÉÄÜΪNone  | 
|       | 
|     playerOpInfo = ""  | 
|     playerJob = 0  | 
|     playerName = ""  | 
|     playerRealmLV = 0  | 
|       | 
|     if curPlayer:  | 
|         playerID = curPlayer.GetID()  | 
|         playerJob = curPlayer.GetJob()  | 
|         playerName = curPlayer.GetName()  | 
|         playerRealmLV = curPlayer.GetOfficialRank()  | 
|         playerOpInfo = GetBillboardOperateInfo(curPlayer)  | 
|     else:  | 
|         socialPlayer = PyDataManager.GetPersonalSocialManager().GetSocialPlayer(playerID)  | 
|         if socialPlayer:  | 
|             playerJob = socialPlayer.playerInfo.Job  | 
|             playerName = socialPlayer.playerInfo.PlayerName  | 
|             playerRealmLV = socialPlayer.playerInfo.RealmLV  | 
|         else:  | 
|             curCache = PlayerViewCache.FindViewCache(playerID)  | 
|             if curCache:  | 
|                 cacheDict = PlayerViewCache.GetCachePropDataDict(curCache)  | 
|                 playerJob = cacheDict["Job"]  | 
|                 playerName = cacheDict["Name"]  | 
|                 playerRealmLV = cacheDict["RealmLV"]  | 
|                   | 
|     if not playerName and playerID < 10000:  | 
|         playerJob = random.choice([1, 2])  | 
|         playerName = "testName%s" % playerID  | 
|         playerRealmLV = random.randint(1, 10)  | 
|           | 
|     if bType in ShareDefine.BTValue1_OfficialRankList:  | 
|         value1 = playerRealmLV  | 
|           | 
|     tick = GameWorld.GetGameWorld().GetTick()  | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|     lastSortTick = gameWorld.GetDictByKey(Def_Key_BillboardSortTick % bType)  | 
|     autoSort = ((tick - lastSortTick) >= 60000 or autoSort) # 1·ÖÖÓÇ¿ÖÆÅÅÐòÒ»´Î  | 
|     if autoSort:  | 
|         gameWorld.SetDict(Def_Key_BillboardSortTick % bType, tick)  | 
|           | 
|     UpdatePlayerBillboard(playerID, playerName, playerOpInfo, bType, playerJob, value1, value2, cmpValue, autoSort, cmpValue2, cmpValue3)  | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| #    void        SetType(int inputType);    //_I_KEY_INDEX_ÅÅÐаñÀàÐÍ  | 
| #   | 
| #    void        SetID(int inputID);    //_KEY_ÅÅÐò¶ÔÏóID£¬Òª±£Ö¤ÊÇΨһµÄ  | 
| #   | 
| #    void        SetID2(int inputID2);    //²»Ò»¶¨ÄÜÓÃÉÏ£¬Ä¿Ç°Óû§¸½¼ÓID,±ÈÈçNPCID   | 
| #   | 
| #    void        SetName1(char * inputName1);    //Ãû×Ö1£¬ÓÃÀ´ÏÔʾÅÅÐò¶ÔÏóÃû×Ö   | 
| #   | 
| #    void        SetName2(char * inputName2);    //Ãû×Ö2£¬¸½¼ÓÃû×Ö£¬Ô¤Áô  | 
| #   | 
| #    void        SetType2(int inputType2);    //¸½¼ÓÀàÐÍ£¬ÓÃÀ´±íʾÅÅÐò¶ÔÏóµÄÀàÐÍ£¬±ÈÈç£¬Íæ¼ÒËùÊôÖ°ÒµÃÅÅÉ£¬³èÎïÀàÐÍµÈ  | 
| #   | 
| #    void        SetValue1(int inputValue1);    //ÅÅÐòÒÀÀµµÄÖµ£¬±ÈÈ磬µÈ¼¶  | 
| #   | 
| #    void        SetValue2(int inputValue2);    //ÅÅÐòÒÀÀµµÄÖµ£¬±ÈÈ磬ս¶·Á¦  | 
| #   | 
| #    void        SetCmpValue(int inputCmpValue);    // ±È½ÏȨֵ£¬ÓɾßÌåµÄ¼ÆË㹫ʽ£¨²ß»®¸ø£©Ëã³öÀ´  | 
| #===============================================================================  | 
| ##¸üнÇÉ«ÅÅÐаñ..  | 
| # @param curPlayerID Íæ¼ÒID  | 
| # @param curPlayerName Íæ¼ÒÃû×Ö  | 
| # @param curPlayerOpInfo Íæ¼Òƽ̨ÐÅÏ¢  | 
| # @param billboardIndex ÅÅÐаñË÷Òý  | 
| # @param billboardType ÅÅÐаñ¸½ÊôÀàÐÍ  | 
| # @param value1 ÅÅÐаñÖµ1  | 
| # @param value2 ÅÅÐаñÖµ2  | 
| # @param cmpValue ¼ÓȨֵ  | 
| # @param autoSort ÊÇ·ñ×Ô¶¯ÅÅÐò  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¸üнÇÉ«ÅÅÐаñ.  | 
| def UpdatePlayerBillboard(curPlayerID, curPlayerName, curPlayerOpInfo, billboardIndex, billboardType,  | 
|                           value1, value2, cmpValue, autoSort = True, cmpValue2 = 0, cmpValue3 = 0):  | 
|       | 
|     playerBillBoard, playerBillBoardData = GetBillBoardData(billboardIndex, curPlayerID, cmpValue, cmpValue2, cmpValue3)  | 
|       | 
|     if playerBillBoard == None or playerBillBoardData == None:  | 
|         #ÎÞ·¨Éϰñ  | 
|         return False  | 
|       | 
|     isNewData = playerBillBoardData.GetID2() == 0 # ÊÇ·ñÊÇÐÂÔöµÄÊý¾Ý  | 
|       | 
|     # ÖµÏàͬ²»¸üР | 
|     if not isNewData and playerBillBoardData.GetValue1() == value1 and playerBillBoardData.GetValue2() == value2 \  | 
|         and playerBillBoardData.GetCmpValue() == cmpValue and playerBillBoardData.GetCmpValue2() == cmpValue2:  | 
|         GameWorld.DebugLog("¸üÐÂÅÅÐаñÖµÏàͬ²»¸üÐÂ! index=%s,type2=%s,value1=%s,value2=%s,cmpValue=%s,cmpValue2==%s,cmpValue3==%s"   | 
|                            % (billboardIndex, billboardType, value1, value2, cmpValue, cmpValue2, cmpValue3), curPlayerID)  | 
|         opInfo = playerBillBoardData.GetName2()  | 
|         if opInfo != str(curPlayerOpInfo):  | 
|             playerBillBoardData.SetName2(str(curPlayerOpInfo))  | 
|             GameWorld.DebugLog("    ¸üÐÂoperatInfo=%s" % curPlayerOpInfo, curPlayerID)  | 
|         if playerBillBoardData.GetType2() != billboardType:  | 
|             playerBillBoardData.SetType2(billboardType)  | 
|             GameWorld.DebugLog("    ¸üÐÂType2=%s" % billboardType, curPlayerID)  | 
|         return False  | 
|       | 
|     # Ã»ÉèÖÃֵĬÈÏΪʱ¼ätime£¬ÏÈÉϰñµÄÅÅÇ°Ãæ  | 
|     if cmpValue3 == 0:  | 
|         # Ê±¼äȨֵ½öÔڱȽÏÖµ±ä¸üµÄÇé¿öϲŸüÐÂ, ·ÀÖ¹ÆäËû¸½ÊôÖµ¸üÐÂʱµ¼Ö±ȽÏÖµÏàͬµÄÍæ¼ÒÃû´Î¼ä»á±ä¶¯µÄÎÊÌâ  | 
|         if isNewData or playerBillBoardData.GetCmpValue() != cmpValue or playerBillBoardData.GetCmpValue2() != cmpValue2:  | 
|             calcTime = GameWorld.ChangeTimeStrToNum("2080-01-01 00:00:00")  | 
|             cmpValue3 = max(0, calcTime - int(time.time())) # ±È½ÏÖµ3Èç¹ûûָ¶¨ÖµÔòĬÈϴ浱ǰ¸üеÄtime  | 
|   | 
|     #ÉèÖÃÅÅÐаñÊý¾Ý  | 
|     playerBillBoardData.SetType(billboardIndex)  | 
|     #¸½ÊôÀàÐÍ  | 
|     playerBillBoardData.SetType2(billboardType)  | 
|     playerBillBoardData.SetID(curPlayerID)  | 
|     playerBillBoardData.SetID2(curPlayerID)  | 
|     playerBillBoardData.SetName1(curPlayerName)  | 
|     playerBillBoardData.SetName2(str(curPlayerOpInfo))  | 
|     #SetValue1´æ´¢¿Õ¼äΪWord  | 
|     playerBillBoardData.SetValue1(value1)  | 
|     #SetValue2´æ´¢¿Õ¼äΪDWord  | 
|     playerBillBoardData.SetValue2(value2)  | 
|     playerBillBoardData.SetCmpValue(cmpValue)  | 
|     playerBillBoardData.SetCmpValue2(cmpValue2)  | 
|     if cmpValue3 > 0:  | 
|         playerBillBoardData.SetCmpValue3(cmpValue3)  | 
|       | 
|     GameWorld.DebugLog("¸üÐÂÅÅÐаñÖµ index=%s,type2=%s,value1=%s,value2=%s,cmpValue=%s,cmpValue2==%s,cmpValue3==%s,isNewData=%s"   | 
|                        % (billboardIndex, billboardType, value1, value2, cmpValue, cmpValue2, cmpValue3, isNewData), curPlayerID)  | 
|     if not autoSort:  | 
|         #²»×Ô¶¯ÅÅÐò  | 
|         GameWorld.GetGameWorld().SetDict(Def_Key_BillboardNeedSort % billboardIndex, 1) # ÉèÖÃÐèҪϴβ鿴ÐèÒªÏÈÅÅÐò  | 
|         return True  | 
|       | 
|     #ÖØÐÂÅÅÐòÅÅÐаñ  | 
|     playerBillBoard.Sort()  | 
|     return True  | 
|   | 
| #---------------------------------------------------------------------  | 
| ##ÊÇ·ñ¿ÉÒÔ½øÈëÅÅÐаñ  | 
| # @param playerBillBoard ÅÅÐаñʵÀý  | 
| # @param billboardDataID ÅÅÐаñÊý¾ÝID  | 
| # @param cmpValue µ±Ç°¼ÓȨֵ  | 
| # @return ÅÅÐаñÊý¾Ý  | 
| # @remarks   | 
| def __GetAddBillBoardData(playerBillBoard, billboardDataID, cmpValue,  | 
|                           cmpValue2 = 0, cmpValue3 = 0):  | 
|     #»ñÈ¡ÅÅÐаñ×îºóÒ»Ãû  | 
|     if playerBillBoard.GetCount() <= 0:  | 
|         return  | 
|       | 
|     lastBillBoardIndex = playerBillBoard.GetCount() - 1  | 
|     lastBillBoardData = playerBillBoard.At(lastBillBoardIndex)  | 
|   | 
|     if cmpValue < lastBillBoardData.GetCmpValue():  | 
|         #ÎÞ·¨Éϰñ  | 
|         return  | 
|     elif cmpValue == lastBillBoardData.GetCmpValue():   | 
|         if cmpValue2 < lastBillBoardData.GetCmpValue2():  | 
|             return  | 
|         elif cmpValue2 == lastBillBoardData.GetCmpValue2():  | 
|       | 
|             if cmpValue3 <= lastBillBoardData.GetCmpValue3():  | 
|                 return  | 
|       | 
|     #¼·µô×îºóÒ»Ãû  | 
|     playerBillBoard.DeleteByIndex(lastBillBoardIndex)  | 
|     playerBillBoardData = playerBillBoard.AddToBillboard(billboardDataID)  | 
|       | 
|     if not playerBillBoardData:  | 
|         GameWorld.ErrLog('ÅÅÐаñ²åÈëʧ°Ü  curCnt = %s, maxCnt = %s'%(  | 
|                                 playerBillBoard.GetCount(), playerBillBoard.GetMaxCount()))  | 
|       | 
|     return playerBillBoardData  | 
|   | 
|   | 
| #---------------------------------------------------------------------  | 
| ##»ñµÃÖ¸¶¨ÅÅÐаñµÄÖ¸¶¨Êý¾Ý  | 
| # @param billboardIndex ÅÅÐаñË÷Òý  | 
| # @param billboardDataID ÅÅÐаñÊý¾ÝID  | 
| # @param cmpValue µ±Ç°²åÈëÅÅÐаñIDµÄ¼ÓȨֵ  | 
| # @return [ÅÅÐаñ, ÅÅÐаñÊý¾Ý]  | 
| # @remarks »ñµÃÖ¸¶¨ÅÅÐаñµÄÖ¸¶¨Êý¾Ý  | 
| def GetBillBoardData(billboardIndex, billboardDataID, cmpValue,   | 
|                      cmpValue2 = 0, cmpValue3 = 0):  | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|     playerBillBoard = billboardMgr.FindBillboard(billboardIndex)  | 
|       | 
|     if not playerBillBoard:  | 
|         GameWorld.ErrLog('FindBillboardErr, ÅÅÐаñ = %s ÎÞ·¨²éÕÒ'%(billboardIndex))  | 
|         return [playerBillBoard, None]  | 
|       | 
|     playerBillBoardData = playerBillBoard.FindByID(billboardDataID)  | 
|       | 
|     if playerBillBoardData != None:  | 
|         #ÒÑÉϰñ, Ö»¸üÐÂÊý¾Ý  | 
|         return [playerBillBoard, playerBillBoardData]  | 
|       | 
|     if playerBillBoard.IsFull():  | 
|         #ÅÅÐаñÒÑÂú, ¶Ô±ÈÅÅÐаñ×îºóһλ, Èç¹û±È×îºóһλ¸ß, ¼·µô×îºóһλ  | 
|         playerBillBoardData = __GetAddBillBoardData(playerBillBoard, billboardDataID, cmpValue,  | 
|                                                     cmpValue2, cmpValue3)  | 
|         return [playerBillBoard, playerBillBoardData]  | 
|       | 
|     #²åÈëÒ»ÌõÊý¾Ý  | 
|     playerBillBoardData = playerBillBoard.AddToBillboard(billboardDataID)  | 
|       | 
|     return [playerBillBoard, playerBillBoardData]  | 
|   | 
| def MapServer_UpdateTotalRechargeBillboard(cmdList):  | 
|     ##×ܳäÖµµãÊýÅÅÐиüР | 
|     playerID, playerName, playerOpInfo, playerJob, playerLV, totalChangeCoinPoint = cmdList  | 
|     UpdatePlayerBillboard(playerID, playerName, playerOpInfo, ShareDefine.Def_BT_TotalRecharge,  | 
|                           playerJob, playerLV, totalChangeCoinPoint, totalChangeCoinPoint)  | 
|     return  | 
|   | 
| #===============================================================================  | 
| # //B0 20 ²é¿´ÅÅÐÐÖ¸¶¨·¶Î§Êý¾Ý #tagViewBillboardRangeByObjID  | 
| #   | 
| # struct    tagViewBillboardRangeByObjID  | 
| # {  | 
| #    tagHead        Head;  | 
| #    BYTE        BillboardType;    //ÅÅÐаñÀàÐÍ  | 
| #    WORD        ObjID;        //¶ÔÏóID  | 
| # };  | 
| #===============================================================================  | 
| ## ²é¿´ÅÅÐÐÖ¸¶¨·¶Î§Êý¾Ý(ÒÔij¸öÄ¿±êΪ»ù´¡)  | 
| #  @param index: Íæ¼ÒË÷Òý  | 
| #  @param clientData: ¿Í»§¶Ë·â°ü½á¹¹Ìå  | 
| #  @param tick: Ê±¼ä´Á  | 
| #  @return: None  | 
| def ViewBillboardRangeByObjID(index, clientData, tick):  | 
|     return  | 
|   | 
| ## ÅÅÐаñ¸üÐÂÊÇ·ñÊܵȼ¶ÏÞÖÆ  | 
| def IsBillboardLVLimit(playerLV, billboardType):  | 
|     # µÈ¼¶ÅжÏÒÑÓɵØÍ¼´¦Àíµô£¬ÕâÀï²»ÔÙ×öÅÐ¶Ï  | 
|     return True  | 
|   | 
| def RedressBillboard(curPlayer):  | 
|     ## ¾ÀÕýÅÅÐаñÖеÄÍæ¼ÒÃû×ּǼ  | 
|       | 
|     #²»´¦ÀíÅÅÐаñ  | 
|     notRedressBillboardList = [  | 
|                                ShareDefine.Def_BT_Max,  # ÅÅÐаñ×î´óÀàÐÍ  | 
|                                ]  | 
|       | 
|     curPlayerID = curPlayer.GetID()  | 
|     curPlayerName = curPlayer.GetName()  | 
|       | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|     for billboardIndex in ShareDefine.BillboardTypeList:  | 
|         if billboardIndex in notRedressBillboardList:  | 
|             continue  | 
|           | 
|         billBoard = billboardMgr.FindBillboard(billboardIndex)  | 
|         if not billBoard:  | 
|             #ÕÒ²»µ½ÕâÀàÐÍÅÅÐаñ  | 
|             continue  | 
|           | 
|         playerBillBoardData = billBoard.FindByID(curPlayerID)  | 
|         if not playerBillBoardData:  | 
|             #¸ÃÍæ¼ÒûÓÐÔÚÅÅÐаñÉÏ  | 
|             continue  | 
|           | 
|         #¸üÐÂÍæ¼ÒÃû×Ö  | 
|         playerBillBoardData.SetName1(curPlayerName)  | 
|           | 
|     return  | 
|   | 
| def UpdateBillboardRealm(curPlayer):  | 
|     ## ¸üÐÂÅÅÐаñÖеÄÍæ¼Ò¾³½ç¼Ç¼  | 
|       | 
|     curPlayerID = curPlayer.GetID()  | 
|     curOfficialRank = curPlayer.GetOfficialRank()  | 
|       | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|     for billboardIndex in ShareDefine.BTValue1_OfficialRankList:  | 
|         if billboardIndex not in ShareDefine.BillboardTypeList:  | 
|             continue  | 
|           | 
|         billBoard = billboardMgr.FindBillboard(billboardIndex)  | 
|         if not billBoard:  | 
|             #ÕÒ²»µ½ÕâÀàÐÍÅÅÐаñ  | 
|             continue  | 
|           | 
|         playerBillBoardData = billBoard.FindByID(curPlayerID)  | 
|         if not playerBillBoardData:  | 
|             #¸ÃÍæ¼ÒûÓÐÔÚÅÅÐаñÉÏ  | 
|             continue  | 
|           | 
|         #¸üÐÂÍæ¼Ò¾³½ç  | 
|         playerBillBoardData.SetValue1(curOfficialRank)  | 
|           | 
|     return  | 
|   | 
| def UpdateBillboardFace(curPlayer):  | 
|     ## ¸üÐÂÅÅÐаñÖеÄÍæ¼ÒÍ·Ïñ  | 
|       | 
|     curPlayerID = curPlayer.GetID()  | 
|     curFace = curPlayer.GetFace()  | 
|       | 
|     billboardMgr = GameWorld.GetBillboard()  | 
|     for billboardIndex in ShareDefine.BillboardTypeList:  | 
|         billBoard = billboardMgr.FindBillboard(billboardIndex)  | 
|         if not billBoard:  | 
|             #ÕÒ²»µ½ÕâÀàÐÍÅÅÐаñ  | 
|             continue  | 
|           | 
|         playerBillBoardData = billBoard.FindByID(curPlayerID)  | 
|         if not playerBillBoardData:  | 
|             #¸ÃÍæ¼ÒûÓÐÔÚÅÅÐаñÉÏ  | 
|             continue  | 
|           | 
|         playerBillBoardData.SetName2(str(curFace))  | 
|           | 
|     return  |