Пример #1
0
 /// <summary>
 /// Creates a new <see cref="PlayerFactory"/> instance.
 /// </summary>
 /// <param name="serviceProvider">Service provider.</param>
 /// <param name="database">Rhisis database access layer.</param>
 /// <param name="gameResources">Game resources.</param>
 /// <param name="mapManager">Map manager.</param>
 /// <param name="behaviorManager">Behavior manager.</param>
 /// <param name="itemFactory">Item factory.</param>
 public PlayerFactory(IServiceProvider serviceProvider, IRhisisDatabase database, IGameResources gameResources, IMapManager mapManager, IBehaviorManager behaviorManager, IItemFactory itemFactory)
 {
     _serviceProvider = serviceProvider;
     _database        = database;
     _gameResources   = gameResources;
     _mapManager      = mapManager;
     _behaviorManager = behaviorManager;
     _itemFactory     = itemFactory;
     _playerFactory   = ActivatorUtilities.CreateFactory(typeof(PlayerEntity), Type.EmptyTypes);
 }
Пример #2
0
 /// <summary>
 /// Creates a new <see cref="WorldServer"/> instance.
 /// </summary>
 public WorldServer(ILogger <WorldServer> logger, IOptions <WorldConfiguration> worldConfiguration,
                    IWorldServerTaskManager worldServerTaskManager,
                    IGameResources gameResources, IServiceProvider serviceProvider,
                    IMapManager mapManager, IBehaviorManager behaviorManager, IChatCommandManager chatCommandManager, IRhisisDatabase database)
 {
     _logger = logger;
     _worldServerTaskManager = worldServerTaskManager;
     _worldConfiguration     = worldConfiguration.Value;
     _gameResources          = gameResources;
     _serviceProvider        = serviceProvider;
     _mapManager             = mapManager;
     _behaviorManager        = behaviorManager;
     _chatCommandManager     = chatCommandManager;
     _database           = database;
     PacketProcessor     = new FlyffPacketProcessor();
     ServerConfiguration = new NetServerConfiguration(_worldConfiguration.Host, _worldConfiguration.Port, ClientBacklog, ClientBufferSize);
 }
Пример #3
0
 /// <summary>
 /// Creates a new <see cref="NpcFactory"/> instance.
 /// </summary>
 /// <param name="gameResources">Game resources.</param>
 /// <param name="behaviorManager">Behavior manager.</param>
 /// <param name="itemFactory">Item Factory.</param>
 public NpcFactory(IGameResources gameResources, IBehaviorManager behaviorManager, IItemFactory itemFactory)
 {
     _gameResources   = gameResources;
     _behaviorManager = behaviorManager;
     _itemFactory     = itemFactory;
 }