2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.CharacterAppearance;
|
|
|
|
|
using Content.Shared.Chemistry.Reaction;
|
|
|
|
|
using Content.Shared.Chemistry.Reagent;
|
2021-06-13 14:52:40 +02:00
|
|
|
using Content.Shared.IoC;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Localizations;
|
2021-01-23 19:37:28 +01:00
|
|
|
using Content.Shared.Maps;
|
2022-05-05 01:07:42 -07:00
|
|
|
using Content.Shared.Markings;
|
2022-06-11 06:04:19 +12:00
|
|
|
using Robust.Shared;
|
|
|
|
|
using Robust.Shared.Configuration;
|
2021-01-23 19:37:28 +01:00
|
|
|
using Robust.Shared.ContentPack;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.Map;
|
2021-01-23 19:37:28 +01:00
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
2021-06-13 14:52:40 +02:00
|
|
|
namespace Content.Shared.Entry
|
2017-08-04 14:24:01 +02:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class EntryPoint : GameShared
|
2017-08-04 14:24:01 +02:00
|
|
|
{
|
2020-08-24 14:10:28 +02:00
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
|
|
|
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
2019-04-03 21:20:26 +02:00
|
|
|
|
2020-05-02 20:01:06 +02:00
|
|
|
public override void PreInit()
|
2017-08-04 14:24:01 +02:00
|
|
|
{
|
2019-04-03 21:20:26 +02:00
|
|
|
IoCManager.InjectDependencies(this);
|
2021-03-28 08:26:32 +02:00
|
|
|
SharedContentIoC.Register();
|
2020-05-02 20:01:06 +02:00
|
|
|
|
2021-02-23 22:09:28 +01:00
|
|
|
Localization.Init();
|
2020-05-02 20:01:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Init()
|
|
|
|
|
{
|
2017-08-04 14:24:01 +02:00
|
|
|
}
|
2019-04-03 21:20:26 +02:00
|
|
|
|
|
|
|
|
public override void PostInit()
|
|
|
|
|
{
|
|
|
|
|
base.PostInit();
|
|
|
|
|
|
|
|
|
|
_initTileDefinitions();
|
2021-03-28 08:26:32 +02:00
|
|
|
IoCManager.Resolve<SpriteAccessoryManager>().Initialize();
|
2022-05-05 01:07:42 -07:00
|
|
|
IoCManager.Resolve<MarkingManager>().Initialize();
|
2021-01-23 19:37:28 +01:00
|
|
|
|
2022-06-11 06:04:19 +12:00
|
|
|
var configMan = IoCManager.Resolve<IConfigurationManager>();
|
2022-06-24 05:08:01 -07:00
|
|
|
#if FULL_RELEASE
|
|
|
|
|
configMan.OverrideDefault(CVars.NetInterpRatio, 2);
|
|
|
|
|
#else
|
2022-06-11 06:04:19 +12:00
|
|
|
configMan.OverrideDefault(CVars.NetFakeLagMin, 0.075f);
|
|
|
|
|
configMan.OverrideDefault(CVars.NetFakeLoss, 0.005f);
|
|
|
|
|
configMan.OverrideDefault(CVars.NetFakeDuplicates, 0.005f);
|
2022-06-15 16:07:34 +12:00
|
|
|
|
|
|
|
|
// fake lag rand leads to messages arriving out of order. Sadly, networking is not robust enough, so for now
|
|
|
|
|
// just leaving this disabled.
|
|
|
|
|
// configMan.OverrideDefault(CVars.NetFakeLagRand, 0.01f);
|
2022-06-11 06:04:19 +12:00
|
|
|
#endif
|
2021-01-23 19:37:28 +01:00
|
|
|
|
2019-04-03 21:20:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void _initTileDefinitions()
|
|
|
|
|
{
|
|
|
|
|
// Register space first because I'm a hard coding hack.
|
|
|
|
|
var spaceDef = _prototypeManager.Index<ContentTileDefinition>("space");
|
|
|
|
|
|
|
|
|
|
_tileDefinitionManager.Register(spaceDef);
|
|
|
|
|
|
|
|
|
|
var prototypeList = new List<ContentTileDefinition>();
|
|
|
|
|
foreach (var tileDef in _prototypeManager.EnumeratePrototypes<ContentTileDefinition>())
|
|
|
|
|
{
|
2022-01-04 16:26:07 -08:00
|
|
|
if (tileDef.ID == "space")
|
2019-04-03 21:20:26 +02:00
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2021-01-23 19:37:28 +01:00
|
|
|
|
2019-04-03 21:20:26 +02:00
|
|
|
prototypeList.Add(tileDef);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Sort ordinal to ensure it's consistent client and server.
|
|
|
|
|
// So that tile IDs match up.
|
2022-01-04 16:26:07 -08:00
|
|
|
prototypeList.Sort((a, b) => string.Compare(a.ID, b.ID, StringComparison.Ordinal));
|
2019-04-03 21:20:26 +02:00
|
|
|
|
|
|
|
|
foreach (var tileDef in prototypeList)
|
|
|
|
|
{
|
|
|
|
|
_tileDefinitionManager.Register(tileDef);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_tileDefinitionManager.Initialize();
|
|
|
|
|
}
|
2017-08-04 14:24:01 +02:00
|
|
|
}
|
|
|
|
|
}
|