Esempio n. 1
0
        public void RequestSwitchToCharacterInSlot(Client client, RequestSwitchToCharacterInSlotPacket packet)
        {
            if (packet.SlotNum < 1 || packet.SlotNum > 16)
            {
                return;
            }

            var unitOfWork = _gameUnitOfWorkFactory.CreateChar();

            client.AccountEntry.SelectedSlot = (byte)packet.SlotNum;
            unitOfWork.GameAccounts.UpdateSelectedSlot(client.AccountEntry.Id, (byte)packet.SlotNum);

            var character = unitOfWork.Characters.GetByAccountId(client.AccountEntry.Id, (byte)packet.SlotNum);

            unitOfWork.Characters.UpdateLoginData(character.Id);
            unitOfWork.Complete();

            client.Player = CreateCharacterManifestation(character);

            _mapChannelManager.PassClientToMap(client);
        }
 private void RequestSwitchToCharacterInSlot(RequestSwitchToCharacterInSlotPacket packet)
 {
     _characterManager.RequestSwitchToCharacterInSlot(Client, packet);
 }