Пример #1
0
        public SCReceiver(string host, int port)
        {
            this.eventSystem.RegisterListener(new EventListener <PacketReceivedEvent>(new Action <PacketReceivedEvent>(this.PacketReceived), null));
            this.eventSystem.RegisterListener(new EventListener <ConnectionReadyEvent>(new Action <ConnectionReadyEvent>(this.ConnectionReady), null));
            UpdateableObject uo = this;

            ThreadPool.QueueUserWorkItem(delegate(object s)
            {
                IAsyncResult asyncResult = this.client.BeginConnect(host, port, null, null);
                bool flag = asyncResult.AsyncWaitHandle.WaitOne(1000);
                if (flag)
                {
                    this.controller = new PacketController(this);
                    uo.SetActive(true);
                    Debug.Log(string.Concat(new object[]
                    {
                        "Connected to ",
                        host,
                        ":",
                        port,
                        ", ",
                        this.Active
                    }));
                    this.Connected = true;
                }
                else
                {
                    this.eventSystem.Invoke <InitialTimeoutEvent>(new InitialTimeoutEvent());
                }
            });
        }
Пример #2
0
 private void Update()
 {
     UpdateableObject.InternalTick();
     this.SetContext();
     if (this.AuthClient != null && this.AuthClient.Initialized() && !this.InitatedPosted)
     {
         this.InitatedPosted = true;
         this.init();
     }
     this.TickSpeed = UpdateableObject.CoreTicksPerSecond;
     if (this.client != null && this.client.rec != null)
     {
         this.ClientSpeed = this.client.rec.TicksPerSecond;
     }
 }
Пример #3
0
 public static void tryStart()
 {
     if (GameTracker.Me == null)
     {
         GameTracker.Me      = new GameObject();
         GameTracker.Tracker = GameTracker.Me.AddComponent <GameTracker>();
         GameTracker.Tracker.start();
         GameTracker.Me.SetActive(true);
         GameTracker.Tracker.SetContext();
         UnityEngine.Object.DontDestroyOnLoad(GameTracker.Me);
         UpdateableObject.Initiate();
         LoggerContext.setMainLogger(new LoggerInstance());
         new Checker();
         Translation.loadTranslations <SFST>();
     }
 }