private World CreateWorld(DateTime serverStartTime, EntityData entityData, BaseData baseData, VehicleData vehicleData, InventoryData inventoryData, PlayerData playerData, GameData gameData, List <Int3> ParsedBatchCells) { World world = new World(); world.TimeKeeper = new TimeKeeper(); world.TimeKeeper.ServerStartTime = serverStartTime; world.SimulationOwnership = new SimulationOwnership(); world.PlayerManager = new PlayerManager(playerData); world.EntityData = entityData; world.EventTriggerer = new EventTriggerer(world.PlayerManager); world.BaseData = baseData; world.VehicleData = vehicleData; world.InventoryData = inventoryData; world.PlayerData = playerData; world.GameData = gameData; ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); world.BatchEntitySpawner = new BatchEntitySpawner(resourceAssets, ParsedBatchCells); return(world); }
public override void RegisterDependencies(ContainerBuilder containerBuilder) { base.RegisterDependencies(containerBuilder); containerBuilder.Register(c => SimulationWhitelist.ForServerSpawned).SingleInstance(); containerBuilder.Register(c => new SubnauticaServerProtobufSerializer("Assembly-CSharp", "Assembly-CSharp-firstpass", "NitroxModel", "NitroxModel-Subnautica")) .As <ServerProtobufSerializer>() .SingleInstance(); containerBuilder.RegisterType <SubnauticaEntitySpawnPointFactory>().As <EntitySpawnPointFactory>().SingleInstance(); ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); containerBuilder.Register(c => resourceAssets).SingleInstance(); containerBuilder.Register(c => resourceAssets.WorldEntitiesByClassId).SingleInstance(); containerBuilder.Register(c => resourceAssets.PlaceholderPrefabsByGroupClassId).SingleInstance(); containerBuilder.RegisterType <SubnauticaUweWorldEntityFactory>().As <UweWorldEntityFactory>().SingleInstance(); SubnauticaUwePrefabFactory prefabFactory = new SubnauticaUwePrefabFactory(resourceAssets.LootDistributionsJson); containerBuilder.Register(c => prefabFactory).As <UwePrefabFactory>().SingleInstance(); Dictionary <TechTypeModel, IEntityBootstrapper> bootstrappersByTechType = new Dictionary <TechTypeModel, IEntityBootstrapper>(); bootstrappersByTechType[TechType.CrashHome.Model()] = new CrashFishBootstrapper(); bootstrappersByTechType[TechType.Reefback.Model()] = new ReefbackBootstrapper(); containerBuilder.Register(c => bootstrappersByTechType).SingleInstance(); }
private World CreateWorld(DateTime serverStartTime, EntityData entityData, BaseData baseData, VehicleData vehicleData, InventoryData inventoryData, PlayerData playerData, GameData gameData, List <Int3> ParsedBatchCells, EscapePodData escapePodData, GameModeOption gameMode) { World world = new World(); world.TimeKeeper = new TimeKeeper(); world.TimeKeeper.ServerStartTime = serverStartTime; world.SimulationOwnershipData = new SimulationOwnershipData(); world.PlayerManager = new PlayerManager(playerData, config); world.EntityData = entityData; world.EventTriggerer = new EventTriggerer(world.PlayerManager); world.BaseData = baseData; world.VehicleData = vehicleData; world.InventoryData = inventoryData; world.PlayerData = playerData; world.GameData = gameData; world.EscapePodData = escapePodData; world.EscapePodManager = new EscapePodManager(escapePodData); world.EntitySimulation = new EntitySimulation(world.EntityData, world.SimulationOwnershipData, world.PlayerManager); world.GameMode = gameMode; ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); world.BatchEntitySpawner = new BatchEntitySpawner(resourceAssets, ParsedBatchCells, serializer); Log.Info("World GameMode: " + gameMode); Log.Info("Server Password: "******"None. Public Server." : config.ServerPassword)); Log.Info("Admin Password: "******"To get help for commands, run help in console or /help in chatbox"); return(world); }
public PacketHandler(PlayerManager playerManager, TimeKeeper timeKeeper, SimulationOwnership simulationOwnership) { this.playerManager = playerManager; defaultPacketProcessor = new DefaultServerPacketProcessor(playerManager); ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); EntityData entityData = new EntityData(); Dictionary <Type, object> ProcessorArguments = new Dictionary <Type, object> { { typeof(PlayerManager), playerManager }, { typeof(TimeKeeper), timeKeeper }, { typeof(SimulationOwnership), simulationOwnership }, { typeof(EscapePodManager), new EscapePodManager() }, { typeof(EntityManager), new EntityManager(entityData, new BatchEntitySpawner(resourceAssets)) }, { typeof(EntitySimulation), new EntitySimulation(entityData, simulationOwnership) } }; authenticatedPacketProcessorsByType = PacketProcessor.GetProcessors(ProcessorArguments, p => p.BaseType.IsGenericType && p.BaseType.GetGenericTypeDefinition() == typeof(AuthenticatedPacketProcessor <>)); unauthenticatedPacketProcessorsByType = PacketProcessor.GetProcessors(ProcessorArguments, p => p.BaseType.IsGenericType && p.BaseType.GetGenericTypeDefinition() == typeof(UnauthenticatedPacketProcessor <>)); }
private World CreateWorld(DateTime serverStartTime, EntityData entityData, BaseData baseData, VehicleData vehicleData, InventoryData inventoryData, PlayerData playerData, GameData gameData, List <Int3> ParsedBatchCells, EscapePodData escapePodData, GameModeOption gameMode) { World world = new World(); world.TimeKeeper = new TimeKeeper(); world.TimeKeeper.ServerStartTime = serverStartTime; world.SimulationOwnershipData = new SimulationOwnershipData(); world.PlayerManager = new PlayerManager(playerData); world.EntityData = entityData; world.EventTriggerer = new EventTriggerer(world.PlayerManager); world.BaseData = baseData; world.VehicleData = vehicleData; world.InventoryData = inventoryData; world.PlayerData = playerData; world.GameData = gameData; world.EscapePodData = escapePodData; world.EscapePodManager = new EscapePodManager(escapePodData); world.EntitySimulation = new EntitySimulation(world.EntityData, world.SimulationOwnershipData, world.PlayerManager); world.GameMode = gameMode; ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); world.BatchEntitySpawner = new BatchEntitySpawner(resourceAssets, ParsedBatchCells, serializer); Log.Info("World GameMode " + gameMode); Log.Info("Server Admin Password : "******" You can set your own password in the server config file or by using the /changepassword command"); return(world); }
public override void RegisterDependencies(ContainerBuilder containerBuilder) { base.RegisterDependencies(containerBuilder); containerBuilder.Register(c => SimulationWhitelist.ForServerSpawned).SingleInstance(); containerBuilder.Register(c => new SubnauticaServerProtoBufSerializer( "Assembly-CSharp", "Assembly-CSharp-firstpass", "NitroxModel", "NitroxModel-Subnautica")) .As <ServerProtoBufSerializer, IServerSerializer>() .SingleInstance(); containerBuilder.Register(c => new SubnauticaServerJsonSerializer()) .As <ServerJsonSerializer, IServerSerializer>() .SingleInstance(); containerBuilder.RegisterType <SubnauticaEntitySpawnPointFactory>().As <EntitySpawnPointFactory>().SingleInstance(); ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); containerBuilder.Register(c => resourceAssets).SingleInstance(); containerBuilder.Register(c => resourceAssets.WorldEntitiesByClassId).SingleInstance(); containerBuilder.Register(c => resourceAssets.PrefabPlaceholderGroupsByGroupClassId).SingleInstance(); containerBuilder.Register(c => resourceAssets.NitroxRandom).SingleInstance(); containerBuilder.RegisterType <SubnauticaUweWorldEntityFactory>().As <UweWorldEntityFactory>().SingleInstance(); SubnauticaUwePrefabFactory prefabFactory = new SubnauticaUwePrefabFactory(resourceAssets.LootDistributionsJson); containerBuilder.Register(c => prefabFactory).As <UwePrefabFactory>().SingleInstance(); containerBuilder.Register(c => new Dictionary <NitroxTechType, IEntityBootstrapper> { [TechType.CrashHome.ToDto()] = new CrashFishBootstrapper(), [TechType.Reefback.ToDto()] = new ReefbackBootstrapper(), [TechType.None.ToDto()] = new UntypedCellEntityBootstrapper() }).SingleInstance(); containerBuilder.RegisterType <SubnauticaMap>().As <IMap>().InstancePerLifetimeScope(); }
private World CreateWorld(DateTime serverStartTime, EntityData entityData, NitroxServer.GameLogic.Bases.BaseData baseData, VehicleData vehicleData, InventoryData inventoryData, PlayerData playerData, GameData gameData, List <Int3> parsedBatchCells, EscapePodData escapePodData, GameModeOption gameMode) { World world = new World(); world.TimeKeeper = new TimeKeeper(); world.TimeKeeper.ServerStartTime = serverStartTime; world.SimulationOwnershipData = new SimulationOwnershipData(); world.PlayerManager = new PlayerManager(playerData); world.EntityData = entityData; world.EventTriggerer = new EventTriggerer(world.PlayerManager); world.BaseData = baseData; world.VehicleData = vehicleData; world.InventoryData = inventoryData; world.PlayerData = playerData; world.GameData = gameData; world.EscapePodData = escapePodData; world.EscapePodManager = new EscapePodManager(escapePodData); world.EntitySimulation = new EntitySimulation(world.EntityData, world.SimulationOwnershipData, world.PlayerManager); world.GameMode = gameMode; ResourceAssets resourceAssets = ResourceAssetsParser.Parse(); world.BatchEntitySpawner = new BatchEntitySpawner(resourceAssets, parsedBatchCells); return(world); }