From c67589d9f19e98d24e7459bcbfdcd60b340c0a4b Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 17 一月 2019 00:34:18 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(跨服掉落好物品同步到本分区所有服务器)
---
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py
index 9a8e18d..b782be2 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerTalk.py
@@ -175,9 +175,10 @@
content = sendPack.GetContent()
extraValue = sendPack.GetExtraValue()
extras = sendPack.GetExtras()
+ crossPlayerName = CrossRealmPlayer.GetCrossPlayerName(curPlayer)
## 发送到跨服服务器,直接使用跨服boss的分区配置
- dataMsg = {"PlayerID":playerID, "Content":content, "ExtraValue":extraValue, "Extras":extras}
+ dataMsg = {"PlayerID":playerID, "Name":crossPlayerName, "Content":content, "ExtraValue":extraValue, "Extras":extras}
CrossRealmMsg.SendMsgToCrossServer(ShareDefine.ClientServerMsg_ChatCrossWorld, dataMsg)
return
@@ -194,13 +195,31 @@
## 收到跨服世界频道聊天
playerID = msgData["PlayerID"]
+ crossPlayerName = msgData["Name"]
content = msgData["Content"]
extraValue = msgData["ExtraValue"]
extras = msgData["Extras"]
- curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
- if curPlayer:
- curPlayer.ChatCountry(content, extraValue, extras)
+ sendPack = ChNetSendPack.tagTalkCountry()
+ sendPack.Clear()
+ sendPack.Name = crossPlayerName
+ sendPack.NameLen = len(sendPack.Name)
+ sendPack.PlayerID = playerID
+ sendPack.Content = content
+ sendPack.Len = len(sendPack.Content)
+ sendPack.ExtraValue = extraValue
+ sendPack.Extras = extras
+
+ # 全服广播在线玩家
+ playerManager = GameWorld.GetPlayerManager()
+ for i in xrange(playerManager.GetActivePlayerCount()):
+ player = playerManager.GetActivePlayerAt(i)
+ if player == None:
+ continue
+ if PlayerControl.GetIsTJG(player):
+ continue
+ NetPackCommon.SendFakePack(player, sendPack)
+ #curPlayer.ChatCountry(content, extraValue, extras)
return
## 公频(封包参数)
--
Gitblit v1.8.0