public ServerConnectionEventArgs(ServerConnection serverConnection, int requestId, string command, object[] parameters) { this.serverConnection = serverConnection; this.requestId = requestId; this.command = command; this.parameters = parameters; }
public void Connect(string host, int port) { serverHost = host; serverIp = Dns.GetHostAddresses(host)[0]; serverPort = port; battle = null; battleID = 0; existingUsers = new Dictionary<string, User>(); existingChannels = new Dictionary<string, ExistingChannel>(); joinedChannels = new Dictionary<string, Channel>(); isChanScanning = false; isLoggedIn = false; isConnected = false; username = ""; try { con = new ServerConnection(); con.Connect(host, port); con.ConnectionClosed += OnConnectionClosed; con.CommandRecieved += OnCommandRecieved; } catch { con = null; if (ConnectionLost != null) ConnectionLost(this, new TasEventArgs("Cannot connect to remote machine")); } }