Example #1
0
        /// <summary>
        ///     Sets the data.
        /// </summary>
        public void SetData(LogicClientAvatar avatar)
        {
            this._avatarId        = avatar.GetId();
            this._homeId          = avatar.GetCurrentHomeId();
            this._avatarName      = avatar.GetName();
            this._facebookId      = avatar.GetFacebookId();
            this._expLevel        = avatar.GetExpLevel();
            this._leagueType      = avatar.GetLeagueType();
            this._nameChangeState = avatar.GetNameChangeState();
            this._nameSetByUser   = avatar.GetNameSetByUser();

            if (avatar.IsInAlliance())
            {
                this._allianceId       = avatar.GetAllianceId();
                this._allianceName     = avatar.GetAllianceName();
                this._allianceExpLevel = avatar.GetAllianceExpLevel();
                this._allianceRole     = avatar.GetAllianceRole();
                this._badgeId          = avatar.GetAllianceBadge();
            }
        }
        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);
            }
        }