Пример #1
0
        private void BroadcastHitsMessage()
        {
            if (this.Hits.Count == 0 && this.BuffActions.Count == 0 && this.CastSkills.Count == 0)
            {
                return;
            }
            NetMessageResponse message = new NetMessageResponse();

            if (this.CastSkills.Count > 0)
            {
                message.skillCast = new SkillCastResponse();
                message.skillCast.castInfoes.AddRange(this.CastSkills);
                message.skillCast.Result   = Result.Success;
                message.skillCast.Errormsg = "";
            }
            if (this.Hits.Count > 0)
            {
                message.skillHits = new SkillHitResponse();
                message.skillHits.Hits.AddRange(this.Hits);
                message.skillHits.Result   = Result.Success;
                message.skillHits.Errormsg = "";
            }
            if (this.BuffActions.Count > 0)
            {
                message.buffRes = new BuffResponse();
                message.buffRes.Buffs.AddRange(this.BuffActions);
                message.buffRes.Result   = Result.Success;
                message.buffRes.Errormsg = "";
            }
            this.Map.BrodacastBattleResponse(message);
        }
Пример #2
0
 public void PostProcess(Character from, NetMessageResponse message)
 {
     if (message.Guild == null)
     {
         message.Guild           = new GuildResponse();
         message.Guild.Result    = Result.Success;
         message.Guild.guildInfo = this.GuildInfo(from);
     }
 }
Пример #3
0
 public void PostProcess(NetMessageResponse message)
 {
     if (message.statusNotify == null)
     {
         message.statusNotify = new StatusNotify();
     }
     foreach (var status in this.Status)
     {
         message.statusNotify.Status.Add(status);
     }
     this.Status.Clear();
 }
 /// <summary>
 /// 将状态列表的状态全部传入消息,并清空状态列表
 /// </summary>
 /// <param name="message"></param>
 internal void PostProcess(NetMessageResponse message)
 {
     if (message.statusNotify == null)
     {
         message.statusNotify = new StatusNotify();
     }
     foreach (var item in Status)
     {
         message.statusNotify.Status.Add(item);
     }
     this.Status.Clear();
 }
Пример #5
0
 public void PostProcess(NetMessageResponse message)
 {
     if (friendChanged)
     {
         this.InitFriends();
         if (message.friendList == null)
         {
             message.friendList = new FriendListResponse();
             message.friendList.Friends.AddRange(this.friends);
         }
         friendChanged = false;
     }
 }
Пример #6
0
 public void PostProcess(NetMessageResponse message)
 {
     if (friendChanged)
     {
         Log.InfoFormat("Process>FriendManager:characterID:{0}:{1}", this.Owner.Id, this.Owner.Info.Name);
         this.InitFriends();
         if (message.friendList == null)
         {
             message.friendList = new FriendListResponse();
             message.friendList.Friends.AddRange(this.friends);
         }
         friendChanged = false;
     }
 }
Пример #7
0
 public void PostProcess(NetMessageResponse message)
 {
     if (message.teamInfo == null)
     {
         message.teamInfo             = new TeamInfoResponse();
         message.teamInfo.Result      = Result.Success;
         message.teamInfo.Team        = new NTeamInfo();
         message.teamInfo.Team.Id     = this.Id;
         message.teamInfo.Team.Leader = this.Leader.Id;
         foreach (var member in this.Members)
         {
             message.teamInfo.Team.Members.Add(member.GetBasicInfo());
         }
     }
 }
Пример #8
0
 internal void BroadcastBattleResponse(NetMessageResponse response)
 {
     foreach (var kv in this.MapCharacters)
     {
         if (response.skillCast != null)
         {
             kv.Value.connection.Session.Response.skillCast = response.skillCast;
         }
         if (response.skillHits != null)
         {
             kv.Value.connection.Session.Response.skillHits = response.skillHits;
         }
         if (response.buffRes != null)
         {
             kv.Value.connection.Session.Response.buffRes = response.buffRes;
         }
         kv.Value.connection.SendResponse();
     }
 }
Пример #9
0
 public void PostProcess(NetMessageResponse nessage)
 {
     if (nessage.Chat == null)
     {
         nessage.Chat        = new ChatResponse();
         nessage.Chat.Result = Result.Success;
     }
     this.localIdx  = ChatManager.Instance.GetLocalMessages(this.Owner.Info.mapId, this.localIdx, nessage.Chat.localMessages);
     this.worldIdx  = ChatManager.Instance.GetWorldMessages(this.worldIdx, nessage.Chat.worldMessages);
     this.systemIdx = ChatManager.Instance.GetSystemMessages(this.systemIdx, nessage.Chat.systemMssages);
     if (this.Owner.Team != null)
     {
         this.teamIdx = ChatManager.Instance.GetTeamMessages(this.Owner.Team.Id, this.teamIdx, nessage.Chat.teamMessages);
     }
     if (this.Owner.Guild != null)
     {
         this.guildIdx = ChatManager.Instance.GetGuildMessages(this.Owner.Guild.Id, this.guildIdx, nessage.Chat.guildMessages);
     }
 }
Пример #10
0
        public void ApplyResponse(NetMessageResponse response)
        {
            if (response.statusNotify == null)
            {
                response.statusNotify = new StatusNotify();
            }
            if (gold != 0)
            {
                if (gold > 0)
                {
                    AddStatus(StatusType.Gold, StatusAction.Add, 0, gold);
                }
                else
                {
                    AddStatus(StatusType.Gold, StatusAction.Delete, 0, -gold);
                }
                gold = 0;
            }

            if (items.Count > 0)
            {
                foreach (var item in items)
                {
                    if (item.Value > 0)
                    {
                        AddStatus(StatusType.Item, StatusAction.Add, item.Key, item.Value);
                    }
                    else if (item.Value < 0)
                    {
                        AddStatus(StatusType.Item, StatusAction.Delete, item.Key, -item.Value);
                    }
                }
                items.Clear();
            }

            foreach (var item in Statuses)
            {
                response.statusNotify.Status.Add(item);
            }
            Statuses.Clear();
            Dirty = false;
        }
Пример #11
0
        public void PostProcess(NetMessageResponse message)
        {
            // Log.InfoFormat("PostProcess > Character: characterID:{0}:{1}", this.Id, this.Info.Name);
            this.FriendManager.PostProcess(message);

            if (this.Team != null)
            {
                Log.InfoFormat("PostProcess > Team: characterID:{0}:{1}  {2}<{3}", this.Id, this.Info.Name, TeamUpdateTS, this.Team.timestamp);
                if (TeamUpdateTS < this.Team.timestamp)
                {
                    TeamUpdateTS = Team.timestamp;
                    this.Team.PostProcess(message);
                }
            }

            if (this.Guild != null)
            {
                Log.InfoFormat("PostProcess > Guild: characterID:{0}:{1}  {2}<{3}", this.Id, this.Info.Name, GuildUpdateTS, this.Guild.timestamp);
                if (this.Info.Guild == null)
                {
                    this.Info.Guild = this.Guild.GuildInfo(this);
                    if (message.mapCharacterEnter != null)
                    {
                        GuildUpdateTS = Guild.timestamp;
                    }
                }
                if (GuildUpdateTS < this.Guild.timestamp && message.mapCharacterEnter == null)
                {
                    GuildUpdateTS = Guild.timestamp;
                    this.Guild.PostProcess(this, message);
                }
            }

            if (this.StatusManager.HasStatus)
            {
                this.StatusManager.PostProcess(message);
            }

            this.Chat.PostProcess(message);
        }
Пример #12
0
        public void PostProcess(NetMessageResponse message)
        {
            Log.InfoFormat("PostProcess>Character:characterID{0}:{1}", this.Id, this.Info.Name);
            this.FriendManager.PostProcess(message);

            if (this.Team != null)
            {
                Log.InfoFormat("PostProcess>Team:characterID:{0}:{1}", this.Id, this.Info.Id, TeamUpateTS, this.Team.timestamp);
                if (TeamUpateTS < this.Team.timestamp)
                {
                    TeamUpateTS = Team.timestamp;
                    this.Team.PostProcess(message);
                }
            }

            if (this.StatusManager.HasStatus)
            {
                this.StatusManager.PostProcess(message);
            }

            //公会后处理
            if (this.Guild != null)
            {
                Log.InfoFormat("PostProcess>OnGuild:CharacterID:{0}:{1} {2}<{3}", this.Id, this.Name, GuildUpdateTs, this.Guild.timestemp);
                if (this.Info.Guild == null)
                {
                    this.Info.Guild = this.Guild.GuildInfo(this);
                    if (message.mapCharacterEnter != null)//不是第一次登入
                    {
                        GuildUpdateTs = Guild.timestemp;
                    }
                }
                if (GuildUpdateTs < this.Guild.timestemp && message.mapCharacterEnter == null)
                {
                    GuildUpdateTs = Guild.timestemp;
                    this.Guild.PostProcess(this, message);
                    Log.Info("公会后处理执行");
                }
            }
        }