Exemplo n.º 1
0
        public override void OnDisconnect(NetworkSystem system, NetworkConnection connection, NetIncomingMessage message)
        {
            string reason = message.PeekString();

            if ("MANUAL_DISCONNECT".Equals(reason))
            {
                return;
            }
            StatusMenu statusMenu = GameManager.Instance.menus.SelectMenu <StatusMenu>(1);

            statusMenu.SetStatus("Disconnected", reason);
            statusMenu.SetAction("Main Menu", () => StatusMenu.GoToMain());
        }
Exemplo n.º 2
0
        public void OnStatusChange(NetConnectionStatus status)
        {
            if (status == NetConnectionStatus.InitiatedConnect)
            {
                StatusMenu statusMenu = GameManager.Instance.menus.SelectMenu <StatusMenu>(1);
                statusMenu.SetStatus("Connecting....", "");
                statusMenu.SetAction("Cancel", () =>
                {
                    _system.Client.Disconnect("MANUAL_DISCONNECT");
                    GameManager.Instance.menus.SelectMenu <UIMenu>(0);
                });
            }

            if (status == NetConnectionStatus.Connected)
            {
                _connection.SendPacket(new CPacketLoginStart(_system.Profile), NetDeliveryMethod.ReliableOrdered);
            }
        }