public void StartHosting() { try { if (IsHosting) { HostedServer.Stop(); SyncTimer.Stop(); } HostedServer = new Server(HostPort); HostedServer.Start(); HostedServer.Input += OnHostInput; HostedServer.Output += OnHostOutput; HostedServer.Connect += OnHostConnect; HostedServer.Disconnect += OnHostDisconnect; SyncTimer.Start(); } catch (Exception e) { StopHosting(); Debug.Log(e); } }
private void OnLoad(object sender, EventArgs e) { Server = new Server(25564); Server.Start(); }