コード例 #1
0
        // Login and logout
        /// <summary>
        /// Force client to disconnect.
        /// </summary>
        public static void Disconnect()
        {
            Assistant.Client.Instance.SendToServerWait(new Disconnect());

            // Dalamar:
            // Notify the server for disconnection, mimiking manual logout operations.
            // CUO doesn't support Logout via packet ( their method for handling the disconnect packet is empty )
            // So we handshake directly with the server
            if (!Assistant.Client.IsOSI)
            {
                Assistant.Client.Instance.SendToServerWait(new LogoffNotification()); // Unnecessary, but mimic the normal packet flow of a client.
                Assistant.Client.Instance.SendToServerWait(new ClosedStatusGump());

                Misc.SendToClient("{ENTER}");
            }
        }