public ConsoleManager() { Setup(); consoleReader = new Thread(() => { String input; while (!IsStop) { try { input = Console.ReadLine(); DeletePrevConsoleLine(); PacChatServer.GetServer().Logger.Info(input); if (input == null || input.Trim().Length == 0) { continue; } CommandManager.Instance.ExecuteCommand(ConsoleSender.Instance, input); } catch (Exception e) { PacChatServer.GetServer().Logger.Error(e); } } }); consoleReader.Start(); }
public static ChatUser LoadUser(Guid id) { if (OnlineUsers.ContainsKey(id)) { return(OnlineUsers[id]); } ChatUser result = null; try { result = new ChatUserStore().Load(id); if (result != null) { ConversationStore conversationStore = new ConversationStore(); long time = 0; foreach (Guid cid in result.ConversationID) { time = conversationStore.GetLastActive(cid); result.Conversations.TryAdd(cid, time); } } } catch (Exception e) { PacChatServer.GetServer().Logger.Error(e); } return(result); }
public PacChatServer() { instance = this; new ServerSettings(); protocolProvider = new ProtocolProvider(); SessionRegistry = new SessionRegistry(); Mongo.StartService(); ProfileCache.StartService(); CommandManager.StartService(); RegisterCommand(); Sticker.StartService(); StartNetworkService(); }