public void Parse(BaseClient client, string line) { string[] tokens = line.Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); string commandArg; Command command; int argIndex; if (tokens[0][0] == ':') { commandArg = tokens[1]; argIndex = 2; } else { commandArg = tokens[0]; argIndex = 1; } if (!Commands.TryGetValue(commandArg, out command)) { if (client.IsRegistered() && client is Client) { var c = client as Client; c.Numeric(421, commandArg); } return; } if (command.MinAccess > AccessLevel.Unregistered && !client.IsRegistered()) return; var args = new object[tokens.Length - argIndex + 1]; args[0] = client; Array.Copy(tokens, argIndex, args, 1, tokens.Length - argIndex); }
public static void DeleteName(BaseClient client) { if (!String.IsNullOrEmpty(client.Name)) Names.Remove(client.Name); }
public static void AddUnregistered(BaseClient client) { Unregistered.Add(client); }
public static void AddName(BaseClient client) { Names.Add(client.Name, client); }
public ClientStringEventArgs(BaseClient client, string str) { Client = client; Str = str; }
public static void RemoveUnregistered(BaseClient client) { Unregistered.Remove(client); }
public static bool nick_changing(BaseClient client, string str) { return client.NickChanging == null || client.NickChanging(client, str); }