public ChatClient(string identifier, Config configManager) { Prefix = identifier; Config = configManager; Log = new Logger("Chat Client (" + Prefix + ")"); Users = new Users.UserManager(Actions); Messages = new Messages.MessageManager(Actions); }
public ChatServerContext(Config configManager) { Config = configManager; Actions = new ChatActionContext(); Users = new UserManager(Actions); Messages = new MessageManager(Actions); Channels = new ChannelManager(Actions); }
private void HandleUserUpdate(UserManager manager, User prev, User user) { string data = Shared.Pack( ServerMethod.User, prev.Id, user.Username, user.Colour, Shared.GetPermissions(user) ); foreach (Service session in Sessions) { session.Context.WebSocket.Send(data); } }
private void HandleUserRemove(UserManager manager, User user, UserRemove mode) { string data = Shared.Pack( ServerMethod.Leave, user.Id, user.Username, mode == UserRemove.Forced ? "kick" : "leave", UnixNow, InternalId ); foreach (Service session in Sessions) { if (session.User == user) { continue; } session.Context.WebSocket.Send(data); } }
private void HandleUserClear(UserManager manager) { string data = Shared.Pack(ServerMethod.Clear, 1); foreach (Service session in Sessions) { session.Context.WebSocket.Send(data); } }
private void HandleUserAdd(UserManager manager, User user) { string data = Shared.Pack( ServerMethod.Join, UnixNow, user.Id, user.Username, user.Colour, Shared.GetPermissions(user), InternalId ); foreach (Service session in Sessions) { if (session.User == user) { continue; } session.Context.WebSocket.Send(data); } }
private void HandleUserUpdate(UserManager manager, User prev, User user) { }
private void HandleUserRemove(UserManager manager, User user, UserRemove mode) { }
private void HandleUserClear(UserManager manager) { }
private void HandleUserAdd(UserManager manager, User user) { }