Example #1
0
        public override void Received(VirtualClient virtualClient)
        {
            if (virtualClient.ConnectedServerEndPoint != ServerEndPoint.GameServer)
            {
                virtualClient.LoginSuccessResult.Characters.AddRange(this.Characters.Where(x => x.ID != 0).ToList());
                String logtext = "";
                for (int i = 0; i < virtualClient.LoginSuccessResult.Characters.Count; i++)
                {
                    SelectCharacter character = virtualClient.LoginSuccessResult.Characters[i];
                    logtext += i + ") Name: " + character.Name + " Level: " + character.Level + " Race: " + character.Race + "\r\n";
                }

                virtualClient.Logger.LogInfo(logtext);
                virtualClient.OnLoginSuccess();
            }
            else
            {
                CCharacterSelectPacket packet = new CCharacterSelectPacket();
                packet.CharacterIndex = virtualClient.SelectedCharacterIndex;
                virtualClient.SendPacket(packet);
            }
        }