Esempio n. 1
0
 public bool InitByDb(ChatCharacterController _this, ulong characterId, DBCharacterChat dbData)
 {
     //PlayerLog.WriteLog(characterId, "----------Chat--------------------InitByDb--------------------{0}", data.SaveCount);
     _this.mDbData = dbData;
     _this.mChat.InitByDB(_this, _this.mDbData);
     return(true);
 }
Esempio n. 2
0
 //离线数据读取
 public void ApplyVolatileData(ChatCharacterController _this, DBCharacterChatVolatile data)
 {
     foreach (var msg in data.Chats)
     {
         _this.mDbData.Chats.Add(msg);
     }
 }
Esempio n. 3
0
 public DBCharacterChat InitByBase(ChatCharacterController _this, ulong characterId, object[] args = null)
 {
     _this.mDbData = new DBCharacterChat
     {
         Id = characterId
     };
     _this.mChat.InitByBase(_this, _this.mDbData);
     return(_this.mDbData);
 }
Esempio n. 4
0
        public IEnumerator NotifyPlayerEnterGame(Coroutine coroutine, ChatService _this, NotifyPlayerEnterGameInMessage msg)
        {
            ChatCharacterController charController = CharacterManager.Instance.GetCharacterControllerFromMemroy(msg.CharacterId);

            if (charController == null)
            {
                Logger.Fatal("NotifyPlayerEnterGame CharacterId={0}", msg.CharacterId);
                yield break;
            }
            charController.SetMoniterData(msg.Request.Data);
        }
Esempio n. 5
0
        //离开频道
        public static ErrorCodes LeaveChannel(ulong channelId, ChatCharacterController character)
        {
            var cc = GetChannel(channelId);

            if (cc == null)
            {
                return(ErrorCodes.Unknow);
            }
            character.ChannelGuid = 0;
            cc.RemoveCharacter(character);
            return(ErrorCodes.OK);
        }
Esempio n. 6
0
 public void Tick(ChatCharacterController _this)
 {
     if (_this.NetDirty)
     {
         foreach (var child in _this.Children)
         {
             if (child.NetDirty)
             {
                 child.NetDirtyHandle();
             }
         }
         _this.CleanNetDirty();
     }
 }
Esempio n. 7
0
        //进入频道
        public static ErrorCodes EnterChannel(ulong channelId, ChatCharacterController character)
        {
            var cc = GetChannel(channelId);

            if (cc == null)
            {
                return(ErrorCodes.Unknow);
            }
            if (cc.Characters.Count >= cc.GetMaxCount())
            {
                return(ErrorCodes.Unknow);
            }
            if (character.ChannelGuid != 0)
            {
                LeaveChannel(character.ChannelGuid, character);
            }
            character.ChannelGuid = channelId;
            cc.PushCharacter(character);
            return(ErrorCodes.OK);
        }
Esempio n. 8
0
        public DBCharacterChatSimple GetSimpleData(ChatCharacterController _this)
        {
            DBCharacterChatSimple dbSimple;

            CharacterManager <ChatCharacterController, DBCharacterChat, DBCharacterChatSimple, DBCharacterChatVolatile> .
            DataItem data;
            var      dic = CharacterManager.Instance.mDictionary;

            if (dic.TryGetValue(_this.mGuid, out data))
            {
                dbSimple = data.SimpleData;
            }
            else
            {
                Logger.Info("GetSimpleData return null, id = {0}", _this.mGuid);
                dbSimple = new DBCharacterChatSimple();
            }
            dbSimple.Id = _this.mGuid;
            return(dbSimple);
        }
Esempio n. 9
0
        //进入城市
        public static ErrorCodes EnterCity(int cityId, ChatCharacterController character)
        {
            var cm = GetSonCity(cityId);

            if (cm == null)
            {
                return(ErrorCodes.Unknow);
            }
            foreach (var channel in cm.cChannels)
            {
                if (channel.Value.Characters.Count >= channel.Value.GetMaxCount())
                {
                    continue;
                }
                if (character.ChannelGuid != 0)
                {
                    LeaveChannel(character.ChannelGuid, character);
                }
                character.ChannelGuid = channel.Key;
                channel.Value.PushCharacter(character);
                return(ErrorCodes.OK);
            }
            return(ErrorCodes.Unknow);
        }
Esempio n. 10
0
 //初始化(按数据库配置)
 public void InitByDB(ChatCharacterController character, DBCharacterChat dbplayer)
 {
     mImpl.InitByDB(this, character, dbplayer);
 }
Esempio n. 11
0
 //初始化(按数据库配置)
 public void InitByDB(ChatManager _this, ChatCharacterController character, DBCharacterChat dbplayer)
 {
     _this.mCharacter = character;
     _this.mData      = dbplayer.Chats;
 }
Esempio n. 12
0
 //初始化(按初始配置)
 public void InitByBase(ChatManager _this, ChatCharacterController character, DBCharacterChat dbplayer)
 {
     _this.mCharacter = character;
     _this.mData      = dbplayer.Chats;
     _this.MarkDirty();
 }
Esempio n. 13
0
 public void SetMoniterData(ChatCharacterController _this, MsgChatMoniterData data)
 {
     _this.moniterData = data;
 }
Esempio n. 14
0
 public bool GetOnline(ChatCharacterController _this)
 {
     return(_this.Proxy != null && _this.Proxy.Connected);
 }
Esempio n. 15
0
 public void PushCharacter(ChatCharacterController c)
 {
     Characters[c.mGuid] = c;
 }
Esempio n. 16
0
 public void OnDestroy(ChatCharacterController _this)
 {
 }
Esempio n. 17
0
 public void OnSaveData(ChatCharacterController _this, DBCharacterChat data, DBCharacterChatSimple simpleData)
 {
     //PlayerLog.WriteLog(CharacterId, "----------Chat--------------------OnSaveData--------------------{0}", data.SaveCount);
 }
Esempio n. 18
0
 public void ApplyEvent(ChatCharacterController _this, int eventId, string evt, int count)
 {
 }
Esempio n. 19
0
 public List <TimedTaskItem> GetTimedTasks(ChatCharacterController _this)
 {
     return(null);
 }
Esempio n. 20
0
 public void ApplySimpleData(ChatCharacterController _this, DBCharacterChatSimple simpleData)
 {
 }
Esempio n. 21
0
 public void LoadFinished(ChatCharacterController _this)
 {
 }
Esempio n. 22
0
 public void InitChatCharacterController(ChatCharacterController _this)
 {
     _this.mChat     = new ChatManager();
     _this.childs[0] = _this.mChat;
 }
Esempio n. 23
0
 public void RemoveCharacter(ChatCharacterController c)
 {
     Characters.Remove(c.mGuid);
 }
Esempio n. 24
0
 public DBCharacterChat GetData(ChatCharacterController _this)
 {
     return(_this.mDbData);
 }