// 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); } } }
private static void RPC_ClientHandshake(ZRpc rpc, bool needPassword) { m_connectingDialog.gameObject.SetActive(value: false); if (needPassword) { var args = Environment.GetCommandLineArgs(); string prefilledPassword = string.Empty; for (int i = 0; i < args.Length; i++) { if ((args[i].ToLower() == "pwd" || args[i].ToLower() == "+password") && args.Length > i + 1) { prefilledPassword = args[i + 1]; } } if (string.IsNullOrEmpty(prefilledPassword)) { m_passwordDialog.gameObject.SetActive(value: true); InputField componentInChildren = m_passwordDialog.GetComponentInChildren <InputField>(); componentInChildren.ActivateInputField(); m_passwordDialog.GetComponentInChildren <InputFieldSubmit>().m_onSubmit = (pwd) => { if (m_tempPasswordRPC.IsConnected()) { m_passwordDialog.gameObject.SetActive(value: false); Traverse.Create(m_instance).Method("SendPeerInfo", new object[] { m_tempPasswordRPC, pwd }).GetValue(); m_tempPasswordRPC = null; } }; m_tempPasswordRPC = rpc; } else { Debug.Log("Autofill password"); m_passwordDialog.gameObject.SetActive(value: false); Traverse.Create(m_instance).Method("SendPeerInfo", new object[] { rpc, prefilledPassword }).GetValue(); } } else { Traverse.Create(m_instance).Method("SendPeerInfo", new object[] { rpc }).GetValue(); } }