public static NetState GameServerClient(Config.GameServer config) { if (config == null) { return(null); } String address = config.Address.ToString(); NetState ns = (NetState)m_GameServers[address]; if (ns != null) { return(ns); } try { ns = new NetState(config.Address, Core.MessagePump); ns.Start(); ns.Send(new SendSeed()); m_GameServers[address] = ns; return(ns); } catch (Exception e) { log.Error(String.Format("Exception while trying to connect to game server {0} ({1}): {2}", config.Name, address), e); return(null); } }
private void CheckListener() { int num1; Socket[] socketArray1; int num2; IPAddress address1; NetState state1; for (num1 = 0; (num1 < this.m_Listeners.Length); ++num1) { socketArray1 = this.m_Listeners[num1].Slice(); num2 = 0; while ((num2 < socketArray1.Length)) { try { address1 = ((IPEndPoint)socketArray1[num2].RemoteEndPoint).Address; if (!Firewall.IsBlocked(address1)) { goto Label_0064; } Console.WriteLine("Client: {0}: Firewall blocked connection attempt.", address1); try { socketArray1[num2].Shutdown(SocketShutdown.Both); } catch { } try { socketArray1[num2].Close(); goto Label_009A; } catch { goto Label_009A; } } catch { } goto Label_009A; Label_0064: state1 = new NetState(socketArray1[num2], this); state1.Start(); if (state1.Running) { Console.WriteLine("Client: {0}: Connected. [{1} Online]", state1, NetState.Instances.Count); } Label_009A: ++num2; } } }
private void CheckListener() { foreach (var socket in m_Listeners.SelectMany(listener => listener.Slice())) { NetState ns = new NetState(socket, this); ns.Start(); if (ns.Running) { InvokeConnected(ns); } } }
private void CheckListener() { for (int j = 0; j < m_Listeners.Length; ++j) { Socket[] accepted = m_Listeners[j].Slice(); for (int i = 0; i < accepted.Length; ++i) { NetState ns = new NetState(accepted[i], this); ns.Start(); //if ( ns.Running ) // Console.WriteLine( "Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count ); } } }
private void CheckListener() { for (int j = 0; j < m_Listeners.Length; ++j) { Socket[] accepted = m_Listeners[j].Slice(); for (int i = 0; i < accepted.Length; ++i) { NetState ns = new NetState(accepted[i], this); ns.Start(); if (ns.Running) { Console.WriteLine("Client [{0}] Connected [{2}] - [{1} Online]", ns, NetState.Instances.Count, DateTime.Now.ToLongTimeString()); } } } }
private void CheckListener() { for (int j = 0; j < Listeners.Length; ++j) { Socket[] accepted = Listeners[j].Slice(); for (int i = 0; i < accepted.Length; ++i) { NetState ns = new NetState(accepted[i], this); ns.Start(); if (ns.Running) { Utility.WriteConsole(ConsoleColor.Cyan, "Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); } } } }
private void CheckListener() { for (int j = 0; j < m_Listeners.Length; ++j) { Socket[] accepted = m_Listeners[j].Slice(); for (int i = 0; i < accepted.Length; ++i) { var ns = new NetState(accepted[i], this); ns.Start(); if (ns.Running) { Utility.PushColor(ConsoleColor.Green); Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); Utility.PopColor(); } } } }
private void CheckListener() { for (int j = 0; j < m_Listeners.Length; ++j) { var accepted = m_Listeners[j].Slice(); for (int i = 0; i < accepted.Length; ++i) { NetState ns = new NetState(accepted[i], this); ns.Start(); if (ns.Running) { Utility.PushColor(ConsoleColor.Green); Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); Utility.PopColor(); } } } }
private void CheckListener() { foreach (Listener l in Listeners) { Socket[] accepted = l.Slice(); foreach (Socket s in accepted) { NetState ns = new NetState(s, this); ns.Start(); if (ns.Running && Display(ns)) { Utility.PushColor(ConsoleColor.Green); Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); Utility.PopColor(); } } } }
private void CheckListener() { for (var index = 0; index < Listeners.Length; index++) { Listener l = Listeners[index]; Socket[] accepted = l.Slice(); for (var i = 0; i < accepted.Length; i++) { Socket s = accepted[i]; NetState ns = new NetState(s, this); ns.Start(); if (ns.Running && Display(ns)) { Utility.PushColor(ConsoleColor.Green); Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); Utility.PopColor(); } } } }
private void CheckListener() { for (int j = 0; j < m_Listeners.Length; ++j) { Socket[] accepted = m_Listeners[j].Slice(); if (accepted == null) { continue; } for (int i = 0; i < accepted.Length; ++i) { NetState ns = new NetState(accepted[i], this); ns.Start(); if (ns.Running) { log.InfoFormat("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count); } } } }
private void CheckListener() { for ( int j = 0; j < m_Listeners.Length; ++j ) { Socket[] accepted = m_Listeners[j].Slice(); for ( int i = 0; i < accepted.Length; ++i ) { NetState ns = new NetState( accepted[i], this ); ns.Start(); if ( ns.Running ) Console.WriteLine( "Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count ); } } }
public static NetState GameServerClient(Config.GameServer config) { if (config == null) return null; String address = config.Address.ToString(); NetState ns = (NetState)m_GameServers[address]; if (ns != null) return ns; try { ns = new NetState(config.Address, Core.MessagePump); ns.Start(); ns.Send(new SendSeed()); m_GameServers[address] = ns; return ns; } catch (Exception e) { log.Error(String.Format("Exception while trying to connect to game server {0} ({1}): {2}", config.Name, address), e); return null; } }
private void CheckListener() { foreach ( var socket in m_Listeners.SelectMany( listener => listener.Slice() ) ) { NetState ns = new NetState( socket, this ); ns.Start(); if ( ns.Running ) InvokeConnected( ns ); } }