コード例 #1
0
        public void PublishMessage(LogicClientAvatar logicClientAvatar, string message)
        {
            GlobalChatLineMessage globalChatLineMessage = new GlobalChatLineMessage();

            globalChatLineMessage.SetMessage(message);
            globalChatLineMessage.SetAvatarName(logicClientAvatar.GetName());
            globalChatLineMessage.SetAvatarExpLevel(logicClientAvatar.GetExpLevel());
            globalChatLineMessage.SetAvatarLeagueType(logicClientAvatar.GetLeagueType());
            globalChatLineMessage.SetAvatarId(logicClientAvatar.GetId());
            globalChatLineMessage.SetHomeId(logicClientAvatar.GetCurrentHomeId());

            if (logicClientAvatar.IsInAlliance())
            {
                globalChatLineMessage.SetAllianceId(logicClientAvatar.GetAllianceId());
                globalChatLineMessage.SetAllianceName(logicClientAvatar.GetAllianceName());
                globalChatLineMessage.SetAllianceBadgeId(logicClientAvatar.GetAllianceBadgeId());
            }

            foreach (ChatSession session in this.m_sessions.Values)
            {
                session.SendPiranhaMessage(globalChatLineMessage, 1);
            }
        }