From e4c7ebb0311b710f1782d97caaabc745dabfc6da Mon Sep 17 00:00:00 2001
From: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
Date: Thu, 13 Jun 2024 14:09:28 +0300
Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B3=D1=80=D0=BE=D0=BA=D0=B8=20=D0=BA?=
=?UTF-8?q?=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=BD=D0=B5=20=D0=BD?=
=?UTF-8?q?=D0=B0=D0=B8=D0=B3=D1=80=D0=B0=D0=BB=D0=B8=2010=20=D1=87=D0=B0?=
=?UTF-8?q?=D1=81=D0=BE=D0=B2=20=D0=BF=D0=BE=D1=8F=D0=B2=D0=BB=D1=8F=D1=8E?=
=?UTF-8?q?=D1=82=D1=81=D1=8F=20=D1=81=D1=80=D0=B0=D0=B7=D1=83=20=D0=BD?=
=?UTF-8?q?=D0=B0=20=D1=81=D1=82=D0=B0=D0=BD=D1=86=D0=B8=D0=B8.=20(#108)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Lobby/UI/HumanoidProfileEditor.xaml | 5 ++-
.../Lobby/UI/HumanoidProfileEditor.xaml.cs | 40 +++++++++----------
.../GameTicking/GameTicker.Spawning.cs | 8 +++-
.../Shuttles/Systems/ArrivalsSystem.cs | 3 ++
.../ContainerSpawnPointSystem.cs | 6 ++-
.../EntitySystems/SpawnPointSystem.cs | 6 ++-
.../_Sunrise/SunriseCCVars/SunriseCCVars.cs | 10 +++++
7 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
index 2aa87a1fd7..a29fa87140 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
@@ -84,11 +84,12 @@
-
+
+
diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
index c74a736b80..6884707e10 100644
--- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
+++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
@@ -344,16 +344,16 @@ namespace Content.Client.Lobby.UI
#region SpawnPriority
- foreach (var value in Enum.GetValues())
- {
- SpawnPriorityButton.AddItem(Loc.GetString($"humanoid-profile-editor-preference-spawn-priority-{value.ToString().ToLower()}"), (int) value);
- }
-
- SpawnPriorityButton.OnItemSelected += args =>
- {
- SpawnPriorityButton.SelectId(args.Id);
- SetSpawnPriority((SpawnPriorityPreference) args.Id);
- };
+ // foreach (var value in Enum.GetValues())
+ // {
+ // SpawnPriorityButton.AddItem(Loc.GetString($"humanoid-profile-editor-preference-spawn-priority-{value.ToString().ToLower()}"), (int) value);
+ // }
+ //
+ // SpawnPriorityButton.OnItemSelected += args =>
+ // {
+ // SpawnPriorityButton.SelectId(args.Id);
+ // SetSpawnPriority((SpawnPriorityPreference) args.Id);
+ // };
#endregion SpawnPriority
@@ -737,7 +737,7 @@ namespace Content.Client.Lobby.UI
UpdateSexControls();
UpdateGenderControls();
UpdateSkinColor();
- UpdateSpawnPriorityControls();
+ //UpdateSpawnPriorityControls();
UpdateAgeEdit();
UpdateEyePickers();
UpdateSaveButton();
@@ -1405,15 +1405,15 @@ namespace Content.Client.Lobby.UI
PronounsButton.SelectId((int) Profile.Gender);
}
- private void UpdateSpawnPriorityControls()
- {
- if (Profile == null)
- {
- return;
- }
-
- SpawnPriorityButton.SelectId((int) Profile.SpawnPriority);
- }
+ // private void UpdateSpawnPriorityControls()
+ // {
+ // if (Profile == null)
+ // {
+ // return;
+ // }
+ //
+ // SpawnPriorityButton.SelectId((int) Profile.SpawnPriority);
+ // }
private void UpdateHairPickers()
{
diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs
index 596b0bd4c1..2b69505e67 100644
--- a/Content.Server/GameTicking/GameTicker.Spawning.cs
+++ b/Content.Server/GameTicking/GameTicker.Spawning.cs
@@ -4,9 +4,11 @@ using System.Numerics;
using Content.Server.Administration.Managers;
using Content.Server.GameTicking.Events;
using Content.Server.Ghost;
+using Content.Server.Players.PlayTimeTracking;
using Content.Server.Spawners.Components;
using Content.Server.Speech.Components;
using Content.Server.Station.Components;
+using Content.Shared._Sunrise.SunriseCCVars;
using Content.Shared.Database;
using Content.Shared.Mind;
using Content.Shared.Players;
@@ -28,6 +30,7 @@ namespace Content.Server.GameTicking
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
+ [Dependency] private readonly PlayTimeTrackingManager _playTimeTracking = default!;
[ValidatePrototypeId]
public const string ObserverPrototypeName = "MobObserver";
@@ -229,10 +232,13 @@ namespace Content.Server.GameTicking
_playTimeTrackings.PlayerRolesChanged(player);
+ var overall = _playTimeTracking.GetOverallPlaytime(player);
+
// Все появляются в прибытии в начале раунда. Зачем? А мне нравится эта бегающаа орящая толпа.
+ // Игроки у которых наиграно меньше ArrivalsMinHours часов будут появляеться всегда по спавнеру професии.
EntityUid? mobMaybe = null;
var spawnPointType = SpawnPointType.Arrivals;
- if (jobPrototype.AlwaysUseSpawner)
+ if (jobPrototype.AlwaysUseSpawner || overall < TimeSpan.FromHours(_configurationManager.GetCVar(SunriseCCVars.ArrivalsMinHours)))
{
lateJoin = false;
spawnPointType = SpawnPointType.Job;
diff --git a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs
index ac03a17325..b9e68d4801 100644
--- a/Content.Server/Shuttles/Systems/ArrivalsSystem.cs
+++ b/Content.Server/Shuttles/Systems/ArrivalsSystem.cs
@@ -338,6 +338,9 @@ public sealed class ArrivalsSystem : EntitySystem
if (ev.SpawnResult != null)
return;
+ if (ev.DesiredSpawnPointType == SpawnPointType.Job)
+ return;
+
// Only works on latejoin even if enabled.
if (!Enabled || _ticker.RunLevel != GameRunLevel.InRound)
return;
diff --git a/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs b/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
index e213f29d07..8fdcb98365 100644
--- a/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
+++ b/Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
@@ -37,12 +37,14 @@ public sealed class ContainerSpawnPointSystem : EntitySystem
continue;
}
- if (_gameTicker.RunLevel == GameRunLevel.InRound && spawnPoint.SpawnType == SpawnPointType.LateJoin)
+ if (_gameTicker.RunLevel == GameRunLevel.InRound &&
+ spawnPoint.SpawnType == SpawnPointType.LateJoin &&
+ args.DesiredSpawnPointType != SpawnPointType.Job)
{
possibleContainers.Add((uid, spawnPoint, container, xform));
}
- if (_gameTicker.RunLevel != GameRunLevel.InRound &&
+ if ((_gameTicker.RunLevel != GameRunLevel.InRound || args.DesiredSpawnPointType == SpawnPointType.Job) &&
spawnPoint.SpawnType == SpawnPointType.Job &&
(args.Job == null || spawnPoint.Job == args.Job.Prototype))
{
diff --git a/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs b/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs
index 81d041fb48..62b1bba013 100644
--- a/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs
+++ b/Content.Server/Spawners/EntitySystems/SpawnPointSystem.cs
@@ -51,12 +51,14 @@ public sealed class SpawnPointSystem : EntitySystem
}
}
- if (_gameTicker.RunLevel == GameRunLevel.InRound && spawnPoint.SpawnType == SpawnPointType.LateJoin)
+ if (_gameTicker.RunLevel == GameRunLevel.InRound &&
+ spawnPoint.SpawnType == SpawnPointType.LateJoin &&
+ args.DesiredSpawnPointType != SpawnPointType.Job)
{
possiblePositions.Add(xform.Coordinates);
}
- if (_gameTicker.RunLevel != GameRunLevel.InRound &&
+ if ((_gameTicker.RunLevel != GameRunLevel.InRound || args.DesiredSpawnPointType == SpawnPointType.Job) &&
spawnPoint.SpawnType == SpawnPointType.Job &&
(args.Job == null || spawnPoint.Job == args.Job.Prototype))
{
diff --git a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
index 35afc4b79e..626158a772 100644
--- a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
+++ b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
@@ -100,4 +100,14 @@ public sealed class SunriseCCVars
///
public static readonly CVarDef ServersHubList =
CVarDef.Create("servers_hub.urls", "", CVar.SERVERONLY);
+
+ /**
+ * Transit hub
+ */
+
+ ///
+ /// До сколько часов общего наиграного времени игроки будут появляться на станции даже в позднем присоединеии.
+ ///
+ public static readonly CVarDef ArrivalsMinHours =
+ CVarDef.Create("transithub.arrivals_min_hours", 10, CVar.SERVER | CVar.ARCHIVE);
}