High level UNET server.

Ejemplo n.º 1
0
 internal void InternalConnectLocalServer(bool generateConnectMsg)
 {
   if (this.m_FreeMessages == null)
   {
     this.m_FreeMessages = new Stack<LocalClient.InternalMsg>();
     for (int index = 0; index < 64; ++index)
       this.m_FreeMessages.Push(new LocalClient.InternalMsg());
   }
   this.m_LocalServer = NetworkServer.instance;
   this.m_Connection = (NetworkConnection) new ULocalConnectionToServer(this.m_LocalServer);
   this.SetHandlers(this.m_Connection);
   this.m_Connection.connectionId = this.m_LocalServer.AddLocalClient(this);
   this.m_AsyncConnect = NetworkClient.ConnectState.Connected;
   NetworkClient.SetActive(true);
   this.RegisterSystemHandlers(true);
   if (generateConnectMsg)
     this.PostInternalMessage((short) 32);
   this.m_Connected = true;
 }
Ejemplo n.º 2
0
 internal void InternalConnectLocalServer()
 {
     if (this.s_freeMessages == null)
     {
         this.s_freeMessages = new Stack<LocalClient.InternalMsg>();
         for (int i = 0; i < 64; i++)
         {
             LocalClient.InternalMsg item = default(LocalClient.InternalMsg);
             this.s_freeMessages.Push(item);
         }
     }
     this.m_LocalServer = NetworkServer.instance;
     this.m_Connection = new ULocalConnectionToServer(this.m_LocalServer);
     this.m_Connection.connectionId = this.m_LocalServer.AddLocalClient(this);
     this.m_AsyncConnect = NetworkClient.ConnectState.Connected;
     NetworkClient.SetActive(true);
     base.RegisterSystemHandlers(true);
     this.PostInternalMessage(32);
     this.m_Connected = true;
 }
Ejemplo n.º 3
0
 internal void InternalConnectLocalServer()
 {
     if (this.m_FreeMessages == null)
     {
         this.m_FreeMessages = new Stack<InternalMsg>();
         for (int i = 0; i < 0x40; i++)
         {
             InternalMsg item = new InternalMsg();
             this.m_FreeMessages.Push(item);
         }
     }
     this.m_LocalServer = NetworkServer.instance;
     base.m_Connection = new ULocalConnectionToServer(this.m_LocalServer);
     base.SetHandlers(base.m_Connection);
     base.m_Connection.connectionId = this.m_LocalServer.AddLocalClient(this);
     base.m_AsyncConnect = NetworkClient.ConnectState.Connected;
     NetworkClient.SetActive(true);
     base.RegisterSystemHandlers(true);
     this.PostInternalMessage(0x20);
     this.m_Connected = true;
 }
 public ULocalConnectionToServer(NetworkServer localServer)
 {
     base.address = "localServer";
     this.m_LocalServer = localServer;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 
 /// <para>
 /// This shuts down the server and disconnects all clients.
 /// </para>
 /// 
 /// </summary>
 public static void Shutdown()
 {
     if (NetworkServer.s_Instance != null)
       {
     NetworkServer.s_Instance.InternalDisconnectAll();
     if (NetworkServer.s_Instance.m_ServerId != -1)
     {
       NetworkTransport.RemoveHost(NetworkServer.s_Instance.m_ServerId);
       NetworkServer.s_Instance.m_ServerId = -1;
     }
     NetworkServer.s_Instance = (NetworkServer) null;
       }
       NetworkServer.s_Active = false;
       NetworkServer.s_LocalClientActive = false;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 
 /// <para>
 /// Reset the NetworkServer singleton.
 /// </para>
 /// 
 /// </summary>
 public static void Reset()
 {
     NetworkDetailStats.ResetAll();
       NetworkTransport.Shutdown();
       NetworkTransport.Init();
       NetworkServer.s_Instance = (NetworkServer) null;
       NetworkServer.s_Active = false;
       NetworkServer.s_LocalClientActive = false;
 }