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); }
//离线数据读取 public void ApplyVolatileData(ChatCharacterController _this, DBCharacterChatVolatile data) { foreach (var msg in data.Chats) { _this.mDbData.Chats.Add(msg); } }
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); }
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); }
//离开频道 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); }
public void Tick(ChatCharacterController _this) { if (_this.NetDirty) { foreach (var child in _this.Children) { if (child.NetDirty) { child.NetDirtyHandle(); } } _this.CleanNetDirty(); } }
//进入频道 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); }
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); }
//进入城市 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); }
//初始化(按数据库配置) public void InitByDB(ChatCharacterController character, DBCharacterChat dbplayer) { mImpl.InitByDB(this, character, dbplayer); }
//初始化(按数据库配置) public void InitByDB(ChatManager _this, ChatCharacterController character, DBCharacterChat dbplayer) { _this.mCharacter = character; _this.mData = dbplayer.Chats; }
//初始化(按初始配置) public void InitByBase(ChatManager _this, ChatCharacterController character, DBCharacterChat dbplayer) { _this.mCharacter = character; _this.mData = dbplayer.Chats; _this.MarkDirty(); }
public void SetMoniterData(ChatCharacterController _this, MsgChatMoniterData data) { _this.moniterData = data; }
public bool GetOnline(ChatCharacterController _this) { return(_this.Proxy != null && _this.Proxy.Connected); }
public void PushCharacter(ChatCharacterController c) { Characters[c.mGuid] = c; }
public void OnDestroy(ChatCharacterController _this) { }
public void OnSaveData(ChatCharacterController _this, DBCharacterChat data, DBCharacterChatSimple simpleData) { //PlayerLog.WriteLog(CharacterId, "----------Chat--------------------OnSaveData--------------------{0}", data.SaveCount); }
public void ApplyEvent(ChatCharacterController _this, int eventId, string evt, int count) { }
public List <TimedTaskItem> GetTimedTasks(ChatCharacterController _this) { return(null); }
public void ApplySimpleData(ChatCharacterController _this, DBCharacterChatSimple simpleData) { }
public void LoadFinished(ChatCharacterController _this) { }
public void InitChatCharacterController(ChatCharacterController _this) { _this.mChat = new ChatManager(); _this.childs[0] = _this.mChat; }
public void RemoveCharacter(ChatCharacterController c) { Characters.Remove(c.mGuid); }
public DBCharacterChat GetData(ChatCharacterController _this) { return(_this.mDbData); }