Пример #1
0
    // Token: 0x06000728 RID: 1832 RVA: 0x00039EA0 File Offset: 0x000380A0
    public void Update(float dt)
    {
        if (this.m_rpc == null)
        {
            if (this.m_connector == null)
            {
                this.m_connector = new ZConnector2(this.m_msHost, this.m_msPort);
                return;
            }
            if (this.m_connector.UpdateStatus(dt, false))
            {
                this.m_socket = this.m_connector.Complete();
                if (this.m_socket != null)
                {
                    this.m_rpc = new ZRpc(this.m_socket);
                    this.m_rpc.Register <ZPackage>("ServerList", new Action <ZRpc, ZPackage>(this.RPC_ServerList));
                    if (this.m_registerPkg != null)
                    {
                        this.m_rpc.Invoke("RegisterServer2", new object[]
                        {
                            this.m_registerPkg
                        });
                    }
                }
                this.m_connector.Dispose();
                this.m_connector = null;
            }
        }
        ZRpc rpc = this.m_rpc;

        if (rpc != null)
        {
            rpc.Update(dt);
            if (!rpc.IsConnected())
            {
                this.m_rpc.Dispose();
                this.m_rpc = null;
            }
        }
        if (this.m_rpc != null)
        {
            this.m_sendStatsTimer += dt;
            if (this.m_sendStatsTimer > 60f)
            {
                this.m_sendStatsTimer = 0f;
                this.SendStats(60f);
            }
        }
    }