示例#1
0
        /// <summary>
        /// Handles the CharLogonIn packet. This packet is sent in response to a CharLogonOut
        /// packet. If this packet status is successful, we respond by requesting to create a game.
        /// </summary>
        /// <remarks>
        /// Requesting to create a game that already exists is correct because we're told if the
        /// game already exists or has been created successfully when the server responds with a
        /// CreateGameIn packet. From there we just query and join it.
        /// </remarks>
        /// <param name="packet">The packet.</param>
        private void OnCharLogon(RealmServerPacket packet)
        {
            CharLogonIn fromServer = new CharLogonIn(packet);

            LogServer(fromServer);

            if (!fromServer.IsSuccessful())
            {
                Fail(FailureArgs.FailureTypes.FailedToLoginToChat, fromServer.ToString());
                return;
            }

            CreateGameOut toServer = new CreateGameOut(settings.GameName, settings.GamePass, settings.GameDescription, settings.GameDifficulty, 1);

            SendPacket(RealmServerPacketType.CREATEGAME, toServer.GetBytes());
        }
示例#2
0
        /// <summary>
        /// Handles the CharLogonIn packet. This packet is sent in response to a CharLogonOut
        /// packet. If this packet status is successful, we respond by requesting to create a game.
        /// </summary>
        /// <remarks>
        /// Requesting to create a game that already exists is correct because we're told if the
        /// game already exists or has been created successfully when the server responds with a
        /// CreateGameIn packet. From there we just query and join it.
        /// </remarks>
        /// <param name="packet">The packet.</param>
        private void OnCharLogon(RealmServerPacket packet)
        {
            CharLogonIn fromServer = new CharLogonIn(packet);
            LogServer(fromServer);

            if (!fromServer.IsSuccessful())
            {
                Fail(FailureArgs.FailureTypes.FailedToLoginToChat, fromServer.ToString());
                return;
            }

            CreateGameOut toServer = new CreateGameOut(settings.GameName, settings.GamePass, settings.GameDescription, settings.GameDifficulty, 1);
            SendPacket(RealmServerPacketType.CREATEGAME, toServer.GetBytes());
        }