Example #1
0
        public ServerPlayer(ServerPlayerManager playerManager, ServerLogic serverLogic, ServerRegionManager regionManager, ServerNpcManager npcManager, ServerGroundItemManager groundItemManager,
                            string name, string password, NetPeer peer) : base(playerManager, name, (byte)peer.Id)
        {
            _serverLogic = serverLogic;
            playerSkills = new ServerPlayerSkills(this);
            database     = new ServerPlayerDatabase(this, serverLogic.Database);

            ServerInventoryManager inventoryManager = new ServerInventoryManager();

            inventory = new ServerPlayerInventory(this, inventoryManager);
            equipment = new ServerPlayerEquipment(this, inventoryManager);

            combat = new ServerPlayerCombat(_serverLogic, this, playerSkills, equipment);

            _regionManager = regionManager;

            entityRenderer         = new ServerPlayerEntityRenderer(this, npcManager);
            this.groundItemManager = groundItemManager;

            CurrentDialogue = new PlayerDialogue()
            {
                nextStageId = -1
            };

            SubscribePacketListener();

            this.password  = password;
            peer.Tag       = this;
            AssociatedPeer = peer;
            NetworkState   = new PlayerState {
                Id = (byte)peer.Id
            };
        }
Example #2
0
        public ServerPlayerCombat(ServerLogic serverLogic, ServerPlayer player, ServerPlayerSkills playerSkills, ServerPlayerEquipment playerEquipment)
        {
            _serverLogic     = serverLogic;
            _player          = player;
            _playerSkills    = playerSkills;
            _playerEquipment = playerEquipment;

            _attackStyles = new ServerPlayerAttackStyles(_player, _playerEquipment);
        }