Exemplo n.º 1
0
        public override IEnumerator OnLoad(Request request)
        {
            int    faceId = 0;
            string name   = string.Empty;

            if (request.Has("userId"))
            {
                int             userId = request.Get <int>("userId");
                App.Model.MUser user   = App.Util.Cacher.UserCacher.Instance.Get(userId);
                faceId = user.Face;
                name   = user.name;
            }
            else if (request.Has("npcId"))
            {
                int                  npcId      = request.Get <int>("npcId");
                CBaseMap             cBaseMap   = App.Util.SceneManager.CurrentScene as CBaseMap;
                App.Model.MCharacter mCharacter = cBaseMap.GetCharacterFromNpc(npcId);
                faceId = mCharacter.CharacterId;
                name   = mCharacter.Master.name;
            }
            else if (request.Has("characterId"))
            {
                faceId = request.Get <int>("characterId");
                App.Model.Master.MCharacter mCharacter = CharacterCacher.Instance.Get(faceId);
                name = mCharacter.name;
            }
            message = request.Get <string>("message");
            if (name != string.Empty && faceId > 0)
            {
                face.CharacterId = faceId;
                bool isLeft = request.Get <bool>("isLeft");
                if (isLeft)
                {
                    characterNameLeft.text  = name;
                    characterNameRight.text = string.Empty;
                }
                else
                {
                    characterNameRight.text = name;
                    characterNameLeft.text  = string.Empty;
                }
            }
            characterTalk.text = string.Empty;
            StartCoroutine(UpdateMessage());
            yield return(StartCoroutine(base.OnLoad(request)));
        }
Exemplo n.º 2
0
Arquivo: MUser.cs Projeto: zlbsy/sh109
 public void Update(MUser user)
 {
     if (user.Gold != this.Gold)
     {
         this.Gold = user.Gold;
     }
     if (user.Silver != this.Silver)
     {
         this.Silver = user.Silver;
     }
     if (user.Nickname != this.Nickname)
     {
         this.Nickname = user.Nickname;
     }
     if (user.Level != this.Level)
     {
         this.Level = user.Level;
     }
     if (user.Ap != this.Ap)
     {
         this.Ap = user.Ap;
     }
     if (user.MapId != this.MapId)
     {
         this.MapId = user.MapId;
     }
     if (user.LastApDate != this.LastApDate)
     {
         this.LastApDate = user.LastApDate;
     }
     if (user.TopMap != null)
     {
         this.TopMap = user.TopMap;
     }
     if (user.items != null)
     {
         this.items = user.items;
     }
     if (user.equipments != null)
     {
         this.equipments = user.equipments;
     }
     if (user.missions != null)
     {
         this.missions = user.missions;
     }
     if (user.characters != null)
     {
         this.characters = user.characters;
     }
     if (user.battlelist != null)
     {
         this.battlelist = user.battlelist;
     }
     if (user.loginbonus_cnt != this.loginbonus_cnt)
     {
         this.loginbonus_cnt = user.loginbonus_cnt;
     }
     if (user.loginbonus_received != this.loginbonus_received)
     {
         this.loginbonus_received = user.loginbonus_received;
     }
     if (user.progress != null)
     {
         this.Progress.Clear();
         foreach (StoryProgress story in user.progress)
         {
             this.Progress.Add(story.k, story.v);
         }
     }
 }