Skip to content

Commit

Permalink
Merge branch 'master' into roadmap4
Browse files Browse the repository at this point in the history
  • Loading branch information
BL02DL authored Oct 28, 2024
2 parents fd9df29 + cc81578 commit 5ff5e15
Show file tree
Hide file tree
Showing 191 changed files with 565,993 additions and 136 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/_LostParadise @Flybik @Evgencheg
. @BL02DL
**/_LostParadise/** @Flybik @Evgencheg
* @BL02DL
33 changes: 30 additions & 3 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
using Robust.Client.UserInterface.Controllers;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Player;
using Robust.Client.Player;
#if LPP_Sponsors
using Content.Client._LostParadise.Sponsors;
#endif

namespace Content.Client.Lobby;

Expand All @@ -28,6 +33,7 @@ public sealed partial class LobbyUIController : UIController, IOnStateEntered<Lo
[UISystemDependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
[UISystemDependency] private readonly ClientInventorySystem _inventory = default!;
[UISystemDependency] private readonly LoadoutSystem _loadouts = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

private LobbyCharacterPanel? _previewPanel;
private HumanoidProfileEditor? _profileEditor;
Expand Down Expand Up @@ -118,15 +124,25 @@ public void UpdateCharacterUI()
_previewPanel?.SetSummaryText(maybeProfile.Summary);
_humanoid.LoadProfile(_previewDummy.Value, maybeProfile);


#if LPP_Sponsors
var sys = IoCManager.Resolve<SponsorsManager>();
var sponsorTier = 0;
if (sys.TryGetInfo(out var sponsorInfo))
sponsorTier = sponsorInfo.Tier;
var uuid = _playerManager.LocalUser != null ? _playerManager.LocalUser.ToString() ?? "" : "";
#endif
if (UpdateClothes)
{
RemoveDummyClothes(_previewDummy.Value);
if (ShowClothes)
GiveDummyJobClothes(_previewDummy.Value, GetPreferredJob(maybeProfile), maybeProfile);
if (ShowLoadouts)
_loadouts.ApplyCharacterLoadout(_previewDummy.Value, GetPreferredJob(maybeProfile), maybeProfile,
_jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted());
_jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted()
#if LPP_Sponsors
, sponsorTier, uuid
#endif
);
UpdateClothes = false;
}

Expand Down Expand Up @@ -171,9 +187,20 @@ public void RemoveDummyClothes(EntityUid dummy)
/// </summary>
public void GiveDummyJobClothesLoadout(EntityUid dummy, HumanoidCharacterProfile profile)
{
#if LPP_Sponsors
var sys = IoCManager.Resolve<SponsorsManager>();
var sponsorTier = 0;
if (sys.TryGetInfo(out var sponsorInfo))
sponsorTier = sponsorInfo.Tier;
var uuid = _playerManager.LocalUser != null ? _playerManager.LocalUser.ToString() ?? "" : "";
#endif
var job = GetPreferredJob(profile);
GiveDummyJobClothes(dummy, job, profile);
_loadouts.ApplyCharacterLoadout(dummy, job, profile, _jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted());
_loadouts.ApplyCharacterLoadout(dummy, job, profile, _jobRequirements.GetRawPlayTimeTrackers(), _jobRequirements.IsWhitelisted()
#if LPP_Sponsors
, sponsorTier, uuid
#endif
);
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Preferences/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public void UpdateCharacter(ICharacterProfile profile, int slot)
if (sponsorMarkings is not null && sponsorMarkings.Count() > 0)
allowedMarkings = allowedMarkings.Concat(sponsorMarkings).ToArray();
}
var session = _playerManager.LocalSession!;
profile.EnsureValid(session, collection, allowedMarkings);
var session = _playerManager.LocalSession!;
profile.EnsureValid(session, collection, allowedMarkings);
#else
profile.EnsureValid(_playerManager.LocalSession!, collection);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ private void UpdateTraits(bool showUnusable)
_configurationManager,
out _
#if LPP_Sponsors
, 0, sponsorTier, uuid
, 0, sponsorTier, uuid
#endif
);
_traits.Add(trait, usable);
Expand Down
74 changes: 37 additions & 37 deletions Content.Server/Chat/Managers/ChatSanitizationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
// Corvax-Localization-Start
{ "хд", "chatsan-laughs" },
{ "хд.", "chatsan-laughs" },
{ "о-о", "chatsan-wide-eyed" }, // cyrillic о
{ "о.о", "chatsan-wide-eyed" }, // cyrillic о
{ "0_о", "chatsan-wide-eyed" }, // cyrillic о
{ "о-о", "chatsan-wide-eyed" }, // cyrillic о нет
{ "о.о", "chatsan-wide-eyed" }, // cyrillic о нет
{ "0_о", "chatsan-wide-eyed" }, // cyrillic о нет
{ "о/", "chatsan-waves" }, // cyrillic о
{ "о7", "chatsan-salutes" }, // cyrillic о
{ "0_o", "chatsan-wide-eyed" },
{ "0_o", "chatsan-wide-eyed" }, // нет
{ "лмао", "chatsan-laughs" },
{ "лмао.", "chatsan-laughs" },
{ "рофл", "chatsan-laughs" },
{ "рофл.", "chatsan-laughs" },
{ "яхз", "chatsan-shrugs" },
{ "яхз.", "chatsan-shrugs" },
{ ":0", "chatsan-surprised" },
{ ":р", "chatsan-stick-out-tongue" }, // cyrillic р
{ ":р", "chatsan-stick-out-tongue" }, // cyrillic р . в канал гарнитуры
{ "кек", "chatsan-laughs" },
{ "кек.", "chatsan-laughs" },
{ "T_T", "chatsan-cries" },
{ "Т_Т", "chatsan-cries" }, // cyrillic T
{ "T_T", "chatsan-cries" }, // нет
{ "Т_Т", "chatsan-cries" }, // cyrillic T нет
{ "=_(", "chatsan-cries" },
{ "!с", "chatsan-laughs" },
{ "!с.", "chatsan-laughs" },
Expand Down Expand Up @@ -65,60 +65,60 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
// I could've done this with regex, but felt it wasn't the right idea.
{ ":)", "chatsan-smiles" },
{ ":]", "chatsan-smiles" },
{ "=)", "chatsan-smiles" },
{ "=)", "chatsan-smiles" }, // = + улыбается
{ "=]", "chatsan-smiles" },
{ "(:", "chatsan-smiles" },
{ "[:", "chatsan-smiles" },
{ "[:", "chatsan-smiles" }, // : в ООС
{ "(=", "chatsan-smiles" },
{ "[=", "chatsan-smiles" },
{ "^^", "chatsan-smiles" },
{ "^-^", "chatsan-smiles" },
{ ":(", "chatsan-frowns" },
{ ":[", "chatsan-frowns" },
{ "=(", "chatsan-frowns" },
{ "=(", "chatsan-frowns" }, // = + хмурится
{ "=[", "chatsan-frowns" },
{ "):", "chatsan-frowns" },
{ ")=", "chatsan-frowns" },
{ "]:", "chatsan-frowns" },
{ "]:", "chatsan-frowns" }, // : в админ
{ "]=", "chatsan-frowns" },
{ ":D", "chatsan-smiles-widely" },
{ ":D", "chatsan-smiles-widely" }, //нет канала с ключём , . в шёпот
{ "D:", "chatsan-frowns-deeply" },
{ ":O", "chatsan-surprised" },
{ ":O", "chatsan-surprised" }, // . в безопасность
{ ":3", "chatsan-smiles" }, //nope
{ ":S", "chatsan-uncertain" },
{ ":S", "chatsan-uncertain" }, //нет канала с ключём, . в шёпот
{ ":>", "chatsan-grins" },
{ ":<", "chatsan-pouts" },
{ "xD", "chatsan-laughs" },
{ "xD", "chatsan-laughs" }, // нет
{ ":'(", "chatsan-cries" },
{ ":'[", "chatsan-cries" },
{ "='(", "chatsan-cries" },
{ "='(", "chatsan-cries" }, // =' + хмурится
{ "='[", "chatsan-cries" },
{ ")':", "chatsan-cries" },
{ "]':", "chatsan-cries" },
{ "]':", "chatsan-cries" }, // ': в админ чат
{ ")'=", "chatsan-cries" },
{ "]'=", "chatsan-cries" },
{ "]'=", "chatsan-cries" }, // '= в админ чат
{ ";-;", "chatsan-cries" },
{ ";_;", "chatsan-cries" },
{ "qwq", "chatsan-cries" },
{ ":u", "chatsan-smiles-smugly" },
{ ":v", "chatsan-smiles-smugly" },
{ ">:i", "chatsan-annoyed" },
{ ":i", "chatsan-sighs" },
{ "qwq", "chatsan-cries" }, // нет
{ ":u", "chatsan-smiles-smugly" }, // нет канала с ключём, . в шёпот
{ ":v", "chatsan-smiles-smugly" }, // нет канала с ключём, . в шёпот
{ ">:i", "chatsan-annoyed" }, // :i в чат
{ ":i", "chatsan-sighs" }, // нет канала с ключём, . в шёпот
{ ":|", "chatsan-sighs" },
{ ":p", "chatsan-stick-out-tongue" },
{ ";p", "chatsan-stick-out-tongue" },
{ ":b", "chatsan-stick-out-tongue" },
{ "0-0", "chatsan-wide-eyed" },
{ "o-o", "chatsan-wide-eyed" },
{ "o.o", "chatsan-wide-eyed" },
{ "._.", "chatsan-surprised" },
{ ":p", "chatsan-stick-out-tongue" }, // нет канала с ключём, . в шёпот
{ ";p", "chatsan-stick-out-tongue" }, // Р в общий
{ ":b", "chatsan-stick-out-tongue" }, // нет канала с ключём, . в шёпот
{ "0-0", "chatsan-wide-eyed" }, // нет
{ "o-o", "chatsan-wide-eyed" }, // нет
{ "o.o", "chatsan-wide-eyed" }, // нет
{ "._.", "chatsan-surprised" },
{ ".-.", "chatsan-confused" },
{ "-_-", "chatsan-unimpressed" },
{ "smh", "chatsan-unimpressed" },
{ "smh", "chatsan-unimpressed" }, // нет
{ "o/", "chatsan-waves" },
{ "^^/", "chatsan-waves" },
{ ":/", "chatsan-uncertain" },
{ ":\\", "chatsan-uncertain" },
{ ":\\", "chatsan-uncertain" }, // нет канала с \
{ "lmao", "chatsan-laughs" },
{ "lmao.", "chatsan-laughs" },
{ "lol", "chatsan-laughs" },
Expand All @@ -127,23 +127,23 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
{ "lel.", "chatsan-laughs" },
{ "kek", "chatsan-laughs" },
{ "kek.", "chatsan-laughs" },
{ "rofl", "chatsan-laughs" },
{ "rofl", "chatsan-laughs" }, // нет
{ "o7", "chatsan-salutes" },
{ ";_;7", "chatsan-tearfully-salutes"},
{ "idk", "chatsan-shrugs" },
{ "idk.", "chatsan-shrugs" },
{ ";)", "chatsan-winks" },
{ ";]", "chatsan-winks" },
{ "(;", "chatsan-winks" },
{ "[;", "chatsan-winks" },
{ "[;", "chatsan-winks" }, // ; в OOC
{ ":')", "chatsan-tearfully-smiles" },
{ ":']", "chatsan-tearfully-smiles" },
{ "=')", "chatsan-tearfully-smiles" },
{ "=')", "chatsan-tearfully-smiles" }, // =' + улыбается
{ "=']", "chatsan-tearfully-smiles" },
{ "(':", "chatsan-tearfully-smiles" },
{ "[':", "chatsan-tearfully-smiles" },
{ "[':", "chatsan-tearfully-smiles" }, // ': в OOC
{ "('=", "chatsan-tearfully-smiles" },
{ "['=", "chatsan-tearfully-smiles" },
{ "['=", "chatsan-tearfully-smiles" }, // '= в админ чат
};

private bool _doSanitize;
Expand Down
18 changes: 16 additions & 2 deletions Content.Server/Clothing/Systems/LoadoutSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using Content.Shared.Storage;
using Content.Shared.Storage.EntitySystems;
using Robust.Shared.Configuration;
#if LPP_Sponsors
using Content.Server._LostParadise.Sponsors;
#endif

namespace Content.Server.Clothing.Systems;

Expand All @@ -17,7 +20,9 @@ public sealed class LoadoutSystem : EntitySystem
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly SharedStorageSystem _storage = default!;
[Dependency] private readonly PlayTimeTrackingManager _playTimeTracking = default!;

#if LPP_Sponsors
[Dependency] private readonly CheckSponsorSystem _checkSponsor = default!;
#endif

public override void Initialize()
{
Expand All @@ -27,13 +32,22 @@ public override void Initialize()

private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent ev)
{
#if LPP_Sponsors
var sponsorTier = _checkSponsor.CheckUser(ev.Player.UserId).Item2 ?? 0;
var uuid = ev.Player.UserId.ToString();
#endif

if (ev.JobId == null ||
!_configurationManager.GetCVar(CCVars.GameLoadoutsEnabled))
return;

// Spawn the loadout, get a list of items that failed to equip
var failedLoadouts = _loadout.ApplyCharacterLoadout(ev.Mob, ev.JobId, ev.Profile,
_playTimeTracking.GetTrackerTimes(ev.Player), ev.Player.ContentData()?.Whitelisted ?? false);
_playTimeTracking.GetTrackerTimes(ev.Player), ev.Player.ContentData()?.Whitelisted ?? false
#if LPP_Sponsors
, sponsorTier, uuid
#endif
);

// Try to find back-mounted storage apparatus
if (!_inventory.TryGetSlotEntity(ev.Mob, "back", out var item) ||
Expand Down
17 changes: 16 additions & 1 deletion Content.Server/Traits/TraitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
using Content.Shared.Psionics;
using Content.Server.Language;
using Content.Shared.Mood;
#if LPP_Sponsors
using Content.Server._LostParadise.Sponsors;
#endif

namespace Content.Server.Traits;

Expand All @@ -28,6 +31,9 @@ public sealed class TraitSystem : EntitySystem
[Dependency] private readonly PsionicAbilitiesSystem _psionicAbilities = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly LanguageSystem _languageSystem = default!;
#if LPP_Sponsors
[Dependency] private readonly CheckSponsorSystem _checkSponsor = default!;
#endif

public override void Initialize()
{
Expand All @@ -39,6 +45,11 @@ public override void Initialize()
// When the player is spawned in, add all trait components selected during character creation
private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args)
{

#if LPP_Sponsors
var sponsorTier = _checkSponsor.CheckUser(args.Player.UserId).Item2 ?? 0;
var uuid = args.Player.UserId.ToString();
#endif
foreach (var traitId in args.Profile.TraitPreferences)
{
if (!_prototype.TryIndex<TraitPrototype>(traitId, out var traitPrototype))
Expand All @@ -52,7 +63,11 @@ private void OnPlayerSpawnComplete(PlayerSpawnCompleteEvent args)
_prototype.Index<JobPrototype>(args.JobId ?? _prototype.EnumeratePrototypes<JobPrototype>().First().ID),
args.Profile, _playTimeTracking.GetTrackerTimes(args.Player), args.Player.ContentData()?.Whitelisted ?? false, traitPrototype,
EntityManager, _prototype, _configuration,
out _))
out _
#if LPP_Sponsors
, 0, sponsorTier, uuid
#endif
))
continue;

AddTrait(args.Mob, traitPrototype);
Expand Down
24 changes: 20 additions & 4 deletions Content.Shared/Clothing/Loadouts/Systems/LoadoutSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ private void OnMapInit(EntityUid uid, LoadoutComponent component, MapInitEvent a


public List<EntityUid> ApplyCharacterLoadout(EntityUid uid, ProtoId<JobPrototype> job, HumanoidCharacterProfile profile,
Dictionary<string, TimeSpan> playTimes, bool whitelisted)
Dictionary<string, TimeSpan> playTimes, bool whitelisted
#if LPP_Sponsors
, int sponsorTier = 0, string uuid = ""
#endif
)
{
var jobPrototype = _prototype.Index(job);
return ApplyCharacterLoadout(uid, jobPrototype, profile, playTimes, whitelisted);
return ApplyCharacterLoadout(uid, jobPrototype, profile, playTimes, whitelisted
#if LPP_Sponsors
, sponsorTier, uuid
#endif
);
}

/// <summary>
Expand All @@ -56,7 +64,11 @@ public List<EntityUid> ApplyCharacterLoadout(EntityUid uid, ProtoId<JobPrototype
/// <param name="whitelisted">If the player is whitelisted</param>
/// <returns>A list of loadout items that couldn't be equipped but passed checks</returns>
public List<EntityUid> ApplyCharacterLoadout(EntityUid uid, JobPrototype job, HumanoidCharacterProfile profile,
Dictionary<string, TimeSpan> playTimes, bool whitelisted)
Dictionary<string, TimeSpan> playTimes, bool whitelisted
#if LPP_Sponsors
, int sponsorTier = 0, string uuid = ""
#endif
)
{
var failedLoadouts = new List<EntityUid>();

Expand All @@ -72,7 +84,11 @@ public List<EntityUid> ApplyCharacterLoadout(EntityUid uid, JobPrototype job, Hu
if (!_characterRequirements.CheckRequirementsValid(
loadoutProto.Requirements, job, profile, playTimes, whitelisted, loadoutProto,
EntityManager, _prototype, _configuration,
out _))
out _
#if LPP_Sponsors
, 0, sponsorTier, uuid
#endif
))
continue;


Expand Down
Loading

0 comments on commit 5ff5e15

Please sign in to comment.