コード例 #1
0
        public static void Deactivate()
        {
            NetworkHelper.OnFrameData -= HandleFrameData;
            NetworkHelper.OnInitData  -= HandleInitData;

            GameStarted = false;
            ServerSimulator.Stop();
        }
コード例 #2
0
 public static void Setup()
 {
     if (SimulateNetworking)
     {
         ServerSimulator.Setup();
     }
     LSServer.Setup();
 }
コード例 #3
0
        public static void Initialize(NetworkHelper networkHelper)
        {
            NetworkHelper              = networkHelper;
            NetworkHelper.OnFrameData += HandleFrameData;
            NetworkHelper.OnInitData  += HandleInitData;
            NetworkHelper.Initialize();

            LSServer.Initialize();
            GameStarted = false;
            if (SimulateNetworking)
            {
                ServerSimulator.Initialize();
            }
            else
            {
            }
            Registered = false;
        }
コード例 #4
0
 public static void Distribute(byte[] data)
 {
     if (SimulateNetworking)
     {
         ServerSimulator.Receive(data);
     }
     else
     {
         if (isConnected)
         {
             SendMessageToServer(MessageType.Input, data);
         }
         else
         {
             bufferedSendData.Add(data);
         }
     }
 }