Files
crystall-punk-14/Content.Server/Entry/EntryPoint.cs

147 lines
5.5 KiB
C#
Raw Normal View History

using System.IO;
using Content.Server.Administration.Managers;
using Content.Server.Afk;
Data-driven NPC behaviors (#3271) * Data-driven NPC behaviors * Nuked AiLogicProcessor * BehaviorSets are now all stored in yaml (might try making actions also yaml someday) * Added a test to validate all BehaviorSets * Might also try pooling actions in the future to reduce allocs but that'll be way down the line (cough physics). * Forgot to re-add sorting nothing suss * Remove last references * Proper vector2i serialization for tile atmos (#3266) * update map files * update submodule Co-authored-by: cyclowns <cyclowns@protonmail.ch> * Remove weird "S" jumpsuit from existence (#3267) * Change character names to use datasets prototypes (#3259) * Remove old name lists in .txts * Fix tests * LATEST MASTER TECHNOLOGY * Converts AdminMenu to partially use XAML (#3231) * Cleans up Hydroponics content. (#3025) * Adds to IgnoredComponents.cs * Jackboots * Half Done * Moved to diff PR * Everything functional * Fixed Sprays * Nice * Fixed * Update submodule * Fix tests Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> * Stacked sprite visualizer (#3096) * Add Stack Visualizer * Add cigarette pack resources Adds transparent layers for visualizing cigarettes * Add Bag Open/Close Visualizer So storage opened in inventory can have different icons when opened or closed. * Create a component that only enumerates single item Used for creating stuff like matchbox, or cigarettes. As a bonus. It will only update stack visualizer for that particullar item. * Refactoring stuff * Fix other usage of stack in Resources * Add docs * Apply suggestions from code review Apply metalgearsloth suggestions Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Applied suggestions from metalgearsloth * Changed SingleItemStorageComponent to StorageCounterComponent Difference. New component doesn't spawn items, merely counts them. * Refactored StackVisualizer * Fix breakage with master * Update Resources/Prototypes/Entities/Objects/Consumable/fancy.yml Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update with MGS suggestions Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * ApcNet updating fix (#3078) * GridPowerComponent * ApcNet Powered update bugfix * PowerTest fix * Add GridPower to Saltern * test fix * Update canceling cleanup * code cleanup * nullable & code cleanup for test * undo power test nullable * Replaces GridPowerSystem with ApcNetSystem * build fix * Update Content.Server/GameObjects/EntitySystems/ApcNetSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Change all XAML to use spacestation14.io namespace (#3277) * fix pizzaboxes (#3291) Co-authored-by: cyclowns <cyclowns@protonmail.ch> * Spikes fix reopened (#3203) * DoAfter, dead and stun check, DragDropOn * Not ignored anymore * Copied comment deleted * Herbert's an ass * Woops Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> * Make component states dependant on the player getting them (#3280) * Make component states dependant on the player getting them Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> * Updated submodule to v0.3.7. Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: Acruid <shatter66@gmail.com> * Hoe fix (#3296) * Initial (#3297) * Sort reagent dispenser entries (#3272) * Sort reagent dispenser entries Saves manually doing it. * zumzum's suggestion Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> * Made firelocks damageable & destructible (#3303) * Move job priority enum parity test ot unit tests (#3300) * Spill hand contents when dropping them in a fall (#3304) * Spill hand contents when dropping them due to falling down * Better approach * cleanup * grammar * stupid * PauseManager moved to Shared (#3288) * Namespace changes for moving IPauseManager to shared. * Namespace changes for moving ITimerManager from Timers to Timing. * Rebase Fixes. * Update engine submodule to v0.3.8 * Improves kick, teleport and ban menus (#3312) * Fix the admin panel not showing the account name (#3322) * Fix name serialization for secret stashes (#3301) * Fix name serialization for secret stashes * Fix old usages of secret part name * Separate ghost warp message into two (#3310) * Separate ghost warp message into two * Remove redundant arguments * Address reviews * Move properties up * Add health overlay and a command to toggle it (#3278) * Add health overlay bar and a command to toggle it * Remove empty line * Content PR for YAML hot reloading (#3319) * Content PR for YAML hot reloading * Add CanAdminReloadPrototypes (host permission) * IndexedPrototype fixes * Update RobustToolbox * Update RobustToolbox * Add an unconspicuous, meaningless and in no way motivated by any external force XML doc to buckle component * Update RobustToolbox * Update submodule to v0.3.12. * Removed unused using statements that prevented compiling. Removed references to IIndexedPrototype that does not exist anymore in the engine. Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: mirrorcult <notzombiedude@gmail.com> Co-authored-by: cyclowns <cyclowns@protonmail.ch> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: Leo <lzimann@users.noreply.github.com> Co-authored-by: Swept <sweptwastaken@protonmail.com> Co-authored-by: Ygg01 <y.laughing.man.y@gmail.com> Co-authored-by: collinlunn <60152240+collinlunn@users.noreply.github.com> Co-authored-by: komunre <49118681+komunre@users.noreply.github.com> Co-authored-by: Acruid <shatter66@gmail.com> Co-authored-by: Peptide90 <78795277+Peptide90@users.noreply.github.com> Co-authored-by: Clyybber <darkmine956@gmail.com>
2021-02-20 17:37:17 +11:00
using Content.Server.AI.Utility;
using Content.Server.AI.Utility.Considerations;
using Content.Server.AI.WorldState;
2021-06-09 22:19:39 +02:00
using Content.Server.Chat.Managers;
using Content.Server.Connection;
using Content.Server.Database;
2021-06-09 22:19:39 +02:00
using Content.Server.EUI;
using Content.Server.GameTicking;
using Content.Server.GuideGenerator;
2021-12-28 23:31:18 -08:00
using Content.Server.Info;
2021-06-09 22:19:39 +02:00
using Content.Server.IoC;
using Content.Server.Maps;
2021-06-09 22:19:39 +02:00
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.Preferences.Managers;
2019-10-02 10:45:06 +02:00
using Content.Server.Sandbox;
2021-06-09 22:19:39 +02:00
using Content.Server.Voting.Managers;
using Content.Shared.Actions;
using Content.Shared.Administration;
using Content.Shared.Alert;
using Content.Shared.CCVar;
using Content.Shared.Kitchen;
using Robust.Server;
using Robust.Server.Bql;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Server.ServerStatus;
using Robust.Shared.ContentPack;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Server.Entry
{
public sealed class EntryPoint : GameServer
{
private EuiManager _euiManager = default!;
private IVoteManager _voteManager = default!;
/// <inheritdoc />
public override void Init()
{
base.Init();
IoCManager.Resolve<IStatusHost>().SetAczInfo("Content.Client",
new[] { "Content.Client", "Content.Shared", "Content.Shared.Database" });
var factory = IoCManager.Resolve<IComponentFactory>();
2019-07-31 15:02:36 +02:00
factory.DoAutoRegistrations();
foreach (var ignoreName in IgnoredComponents.List)
2019-07-31 15:02:36 +02:00
{
factory.RegisterIgnore(ignoreName);
}
ServerContentIoC.Register();
foreach (var callback in TestingCallbacks)
2019-06-29 01:58:16 +02:00
{
var cast = (ServerModuleTestingCallbacks) callback;
2019-06-29 01:58:16 +02:00
cast.ServerBeforeIoC?.Invoke();
}
IoCManager.BuildGraph();
factory.GenerateNetIds();
var configManager = IoCManager.Resolve<IConfigurationManager>();
var dest = configManager.GetCVar(CCVars.DestinationFile);
if (string.IsNullOrEmpty(dest)) //hacky but it keeps load times for the generator down.
{
_euiManager = IoCManager.Resolve<EuiManager>();
_voteManager = IoCManager.Resolve<IVoteManager>();
var playerManager = IoCManager.Resolve<IPlayerManager>();
var logManager = IoCManager.Resolve<ILogManager>();
logManager.GetSawmill("Storage").Level = LogLevel.Info;
logManager.GetSawmill("db.ef").Level = LogLevel.Info;
IoCManager.Resolve<IConnectionManager>().Initialize();
IoCManager.Resolve<IServerDbManager>().Init();
IoCManager.Resolve<IServerPreferencesManager>().Init();
IoCManager.Resolve<INodeGroupFactory>().Initialize();
IoCManager.Resolve<IGamePrototypeLoadManager>().Initialize();
_voteManager.Initialize();
}
}
public override void PostInit()
{
base.PostInit();
2022-01-19 13:35:31 +11:00
IoCManager.Resolve<IChatSanitizationManager>().Initialize();
IoCManager.Resolve<IChatManager>().Initialize();
var configManager = IoCManager.Resolve<IConfigurationManager>();
var resourceManager = IoCManager.Resolve<IResourceManager>();
var dest = configManager.GetCVar(CCVars.DestinationFile);
if (!string.IsNullOrEmpty(dest))
{
var resPath = new ResourcePath(dest).ToRootedPath();
var file = resourceManager.UserData.OpenWriteText(resPath.WithName("chem_" + dest));
ChemistryJsonGenerator.PublishJson(file);
file.Flush();
file = resourceManager.UserData.OpenWriteText(resPath.WithName("react_" + dest));
ReactionJsonGenerator.PublishJson(file);
file.Flush();
IoCManager.Resolve<IBaseServer>().Shutdown("Data generation done");
}
else
{
IoCManager.Resolve<RecipeManager>().Initialize();
IoCManager.Resolve<BlackboardManager>().Initialize();
IoCManager.Resolve<ConsiderationsManager>().Initialize();
IoCManager.Resolve<IAdminManager>().Initialize();
IoCManager.Resolve<INpcBehaviorManager>().Initialize();
IoCManager.Resolve<IAfkManager>().Initialize();
IoCManager.Resolve<RulesManager>().Initialize();
_euiManager.Initialize();
IoCManager.Resolve<IGameMapManager>().Initialize();
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GameTicker>().PostInitialize();
IoCManager.Resolve<IBqlQueryManager>().DoAutoRegistrations();
2022-02-21 14:11:39 -08:00
IoCManager.Resolve<RoleBanManager>().Initialize();
}
}
2019-08-04 01:08:55 +02:00
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
{
2019-08-04 01:08:55 +02:00
base.Update(level, frameEventArgs);
switch (level)
{
2020-11-10 16:50:28 +01:00
case ModUpdateLevel.PostEngine:
{
_euiManager.SendUpdates();
_voteManager.Update();
break;
}
}
}
}
}