| | |
| | | # @change: "2015-07-14 21:00" xdh 聊天信息原附加值改为Extras
|
| | | # @change: "2015-10-28 00:00" hxp 增加设置对战房间ID
|
| | | # @change: "2015-11-05 12:00" hxp 增加跨服全服广播
|
| | | # @change: "2015-11-06 16:30" hxp 增加GetMergePlayerName
|
| | | # @change: "2017-06-22 15:00" hxp 跨服广播增加条件过滤子服是否提醒;跨服服务器全服广播同步子服
|
| | | #---------------------------------------------------------------------
|
| | | #"""Version = 2017-06-22 15:00"""
|
| | |
| | | import IPY_GameServer
|
| | | import MergeBroadcast
|
| | | import IpyGameDataPY
|
| | | import CrossRealmMsg
|
| | | import ShareDefine
|
| | | import ChConfig
|
| | | import types
|
| | |
| | | return
|
| | |
|
| | | curPlayer.NotifyCode(msgMark, __GetNotifyCodeList(msgParamList))
|
| | | return
|
| | |
|
| | | def NotifyCodeToClientServer(serverGroupID, playerID, msgMark, msgParamList=[]):
|
| | | dataMsg = {"Type":"Player", "ID":playerID, "Mark":msgMark, "Param":msgParamList}
|
| | | CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_Notify, dataMsg, [serverGroupID])
|
| | | return
|
| | |
|
| | | def CrossServerMsg_Notify(notifyInfoDict):
|
| | | notifyType = notifyInfoDict["Type"]
|
| | | notifyID = notifyInfoDict["ID"]
|
| | | if notifyType == "Player":
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(notifyID)
|
| | | if not curPlayer:
|
| | | return
|
| | | NotifyCode(curPlayer, notifyInfoDict["Mark"], notifyInfoDict["Param"])
|
| | | return
|
| | |
|
| | | ## 跨服世界广播
|
| | |
| | | curPlayer.SetVsRoomId(roomID)
|
| | | if isSetMergeRegRoomID:
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MergeRegisterRoomID, roomID)
|
| | | |
| | | battleIDStr = str(roomID)
|
| | | GameWorld.Log("SetVSRoomID playerID=%s, roomID=%s" % (curPlayer.GetPlayerID(), roomID))
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, 'CreatePlayerRoomID', battleIDStr, len(battleIDStr))
|
| | | SetMapServerPlayerAttrValue(curPlayer, "SetVsRoomId", roomID)
|
| | | return
|
| | |
|
| | | ## 根据子服账号及名称获取跨服角色名
|
| | | def GetMergePlayerName(playerAccID, playerName):
|
| | | orgPlayerName = playerName.strip()
|
| | | ## 跨服状态: 0-非跨服状态,1-跨服状态
|
| | | def GetCrossRealmState(curPlayer): return curPlayer.GetExAttr5()
|
| | | def SetCrossRealmState(curPlayer, value):
|
| | | ''' 设置玩家跨服状态
|
| | | @param isExitCrossRealm: 非跨服状态时是否通知前端退出跨服服务器
|
| | | '''
|
| | | curPlayer.SetExAttr5(value)
|
| | | SetMapServerPlayerAttrValue(curPlayer, "SetExAttr5", value)
|
| | | return
|
| | |
|
| | | #取帐号后缀作为区服标识
|
| | | parserList = playerAccID.split('@')
|
| | | serverSign = ""
|
| | | if len(parserList) >= 2:
|
| | | serverSign = parserList[-1] |
| | | |
| | | parserList2 = orgPlayerName.split('-')
|
| | | orgNameServerSign = ""
|
| | | nameNotServerSign = parserList2[0]
|
| | | if len(parserList2) >= 2:
|
| | | orgNameServerSign = parserList2[-1]
|
| | | |
| | | if orgNameServerSign:
|
| | | if orgNameServerSign == serverSign:
|
| | | return orgPlayerName
|
| | | else:
|
| | | return "%s-%s" % (nameNotServerSign, serverSign)
|
| | | |
| | | if serverSign:
|
| | | return "%s-%s" % (nameNotServerSign, serverSign)
|
| | | |
| | | return orgPlayerName
|
| | | def SetMapServerPlayerAttrValue(curPlayer, attrName, value, exData=[]):
|
| | | ## 设置地图服务器玩家对应属性值
|
| | | setAttrInfo = str([attrName, value] + exData)
|
| | | curPlayer.MapServer_QueryPlayerResult(0, 0, "SetPlayerAttr", setAttrInfo, len(setAttrInfo))
|
| | | return
|
| | |
|
| | | ## 地图服务器扣物品
|
| | | # @param curPlayer
|