Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into master-ru
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr0maks committed May 13, 2023
2 parents 4e4ede7 + a6e447f commit 093e627
Show file tree
Hide file tree
Showing 3,268 changed files with 1,642,067 additions and 1,808,662 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ csharp_preserve_single_line_blocks = true
#dotnet_naming_style.begins_with_i.word_separator =
#dotnet_naming_style.begins_with_i.capitalization = pascal_case


dotnet_diagnostic.IDE0055.severity = warning

dotnet_naming_rule.constants_rule.severity = warning
dotnet_naming_rule.constants_rule.style = upper_camel_case_style
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: "publish"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -40,24 +41,24 @@ jobs:
mv release/*.zip "release/${{ github.sha }}"
- name: Upload files to cdn
uses: appleboy/scp-action@master
uses: marcodallasanta/ssh-scp-[email protected]
with:
host: nyanotrasen.moe
username: boywife-ralsei
key: ${{ secrets.BUILDS_PUSH_KEY }}
port: ${{ secrets.PUBLISH_SSH_PORT }}
source: "release/${{ github.sha }}"
target: "/var/www/builds.nyanotrasen.moe/nyanotrasen/builds/"
strip_components: 1
host: ${{ secrets.PUBLISH_HOST }}
port: ${{ secrets.PUBLISH_PORT }}
user: ${{ secrets.PUBLISH_PUSH_USER }}
key: ${{ secrets.PUBLISH_PUSH_KEY }}
scp_options: -r -o StrictHostKeyChecking=no
local: "release/${{ github.sha }}"
remote: "builds"

- name: Update manifest JSON
uses: appleboy/ssh-action@master
with:
host: nyanotrasen.moe
username: boywife-ralsei
key: ${{ secrets.BUILDS_PUSH_KEY }}
port: ${{ secrets.PUBLISH_SSH_PORT }}
script: /var/www/builds.nyanotrasen.moe/manifest.py -c nyanotrasen -v ${{ github.sha }}
host: ${{ secrets.PUBLISH_HOST }}
username: ${{ secrets.PUBLISH_NOTIFY_USER }}
key: ${{ secrets.PUBLISH_NOTIFY_KEY }}
port: ${{ secrets.PUBLISH_PORT }}
script: /home/${{ secrets.PUBLISH_PUSH_USER }}/push.s1 ${{ github.sha }}

- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Wiki
on:
workflow_dispatch:
push:
branches: [ master, jsondump ]
branches: [ master ]
paths:
- '.github/workflows/update-wiki.yml'
- 'Content.Shared/Chemistry/**.cs'
Expand All @@ -18,6 +18,7 @@ jobs:
update-wiki:
name: Build and Publish JSON blobs to wiki
runs-on: ubuntu-latest
environment: "update-wiki"

steps:
- name: Checkout Master
Expand Down Expand Up @@ -56,7 +57,7 @@ jobs:
wiki_text_file: ./bin/Content.Server/data/chem_prototypes.json
edit_summary: Update chem_prototypes.json via GitHub Actions
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/chem_prototypes.json"
api_url: https://wiki.nyanotrasen.moe/api.php
api_url: https://wiki.nyanotrasen.moe/w/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}

Expand All @@ -66,7 +67,6 @@ jobs:
wiki_text_file: ./bin/Content.Server/data/react_prototypes.json
edit_summary: Update react_prototypes.json via GitHub Actions
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/react_prototypes.json"
api_url: https://wiki.nyanotrasen.moe/api.php
api_url: https://wiki.nyanotrasen.moe/w/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"omnisharp.analyzeOpenDocumentsOnly": true
}
7 changes: 0 additions & 7 deletions Content.Client/Access/Components/IdCardConsoleComponent.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Content.Client.Access.Components;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.CrewManifest;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;
using static Content.Shared.Access.Components.SharedIdCardConsoleComponent;
using static Content.Shared.Access.Components.IdCardConsoleComponent;
namespace Content.Client.Access.UI
{
public sealed class IdCardConsoleBoundUserInterface : BoundUserInterface
Expand Down
5 changes: 1 addition & 4 deletions Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Linq;
using Content.Shared.Access;
using Content.Shared.Access.Systems;
Expand All @@ -7,10 +6,8 @@
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using static Content.Shared.Access.Components.SharedIdCardConsoleComponent;
using static Content.Shared.Access.Components.IdCardConsoleComponent;

namespace Content.Client.Access.UI
{
Expand Down
70 changes: 20 additions & 50 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using System.IO;
using System.Linq;
using Content.Client.Popups;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Audio;
using Robust.Shared.ContentPack;
using Robust.Shared.GameStates;
using Robust.Shared.Input.Binding;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager;
using Robust.Shared.Serialization.Markdown;
using Robust.Shared.Serialization.Markdown.Mapping;
Expand All @@ -29,8 +26,6 @@ public sealed class ActionsSystem : SharedActionsSystem
[Dependency] private readonly IResourceManager _resources = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;

[Dependency] private readonly PopupSystem _popupSystem = default!;

public event Action<ActionType>? ActionAdded;
public event Action<ActionType>? ActionRemoved;
public event OnActionReplaced? ActionReplaced;
Expand All @@ -50,6 +45,15 @@ public override void Initialize()
SubscribeLocalEvent<ActionsComponent, ComponentHandleState>(HandleComponentState);
}

public override void Dirty(ActionType action)
{
if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity)
return;

base.Dirty(action);
ActionsUpdated?.Invoke();
}

private void HandleComponentState(EntityUid uid, ActionsComponent component, ref ComponentHandleState args)
{
if (args.Current is not ActionsComponentState state)
Expand Down Expand Up @@ -119,66 +123,32 @@ protected override void AddActionInternal(ActionsComponent comp, ActionType acti

public override void AddAction(EntityUid uid, ActionType action, EntityUid? provider, ActionsComponent? comp = null, bool dirty = true)
{
if (GameTiming.ApplyingState && !action.ClientExclusive)
return;

if (!Resolve(uid, ref comp, false))
return;

dirty &= !action.ClientExclusive;
base.AddAction(uid, action, provider, comp, dirty);

if (uid == _playerManager.LocalPlayer?.ControlledEntity)
ActionAdded?.Invoke(action);
}

public override void RemoveActions(EntityUid uid, IEnumerable<ActionType> actions, ActionsComponent? comp = null, bool dirty = true)
public override void RemoveAction(EntityUid uid, ActionType action, ActionsComponent? comp = null, bool dirty = true)
{
if (uid != _playerManager.LocalPlayer?.ControlledEntity)
if (GameTiming.ApplyingState && !action.ClientExclusive)
return;

if (!Resolve(uid, ref comp, false))
return;

var actionList = actions.ToList();
base.RemoveActions(uid, actionList, comp, dirty);
dirty &= !action.ClientExclusive;
base.RemoveAction(uid, action, comp, dirty);

foreach (var act in actionList)
{
if (act.AutoRemove)
ActionRemoved?.Invoke(act);
}
}

/// <summary>
/// Execute convenience functionality for actions (pop-ups, sound, speech)
/// </summary>
protected override bool PerformBasicActions(EntityUid user, ActionType action, bool predicted)
{
var performedAction = action.Sound != null
|| !string.IsNullOrWhiteSpace(action.UserPopup)
|| !string.IsNullOrWhiteSpace(action.Popup);

if (!GameTiming.IsFirstTimePredicted)
return performedAction;

if (!string.IsNullOrWhiteSpace(action.UserPopup))
{
var msg = (!action.Toggled || string.IsNullOrWhiteSpace(action.PopupToggleSuffix))
? Loc.GetString(action.UserPopup)
: Loc.GetString(action.UserPopup + action.PopupToggleSuffix);

_popupSystem.PopupEntity(msg, user);
}
else if (!string.IsNullOrWhiteSpace(action.Popup))
{
var msg = (!action.Toggled || string.IsNullOrWhiteSpace(action.PopupToggleSuffix))
? Loc.GetString(action.Popup)
: Loc.GetString(action.Popup + action.PopupToggleSuffix);

_popupSystem.PopupEntity(msg, user);
}

if (action.Sound != null)
SoundSystem.Play(action.Sound.GetSound(), Filter.Local(), user, action.AudioParams);

return performedAction;
if (action.AutoRemove && uid == _playerManager.LocalPlayer?.ControlledEntity)
ActionRemoved?.Invoke(action);
}

private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
Expand Down Expand Up @@ -272,7 +242,7 @@ public void LoadActionAssignments(string path, bool userData)
if (PlayerActions == null)
return;

var file = new ResourcePath(path).ToRootedPath();
var file = new ResPath(path).ToRootedPath();
TextReader reader = userData
? _resources.UserData.OpenText(file)
: _resources.ContentFileReadText(file);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/Commands/UploadFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async void Execute(IConsoleShell shell, string argStr, string[] args)
return;
}

var path = new ResourcePath(args[0]).ToRelativePath();
var path = new ResPath(args[0]).ToRelativePath();

var dialog = IoCManager.Resolve<IFileDialogManager>();

Expand Down
76 changes: 76 additions & 0 deletions Content.Client/Administration/Commands/UploadFolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System.IO;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.ContentPack;
using Robust.Shared.Network;
using Robust.Shared.Utility;

namespace Content.Client.Administration.Commands;

public sealed class UploadFolder : IConsoleCommand
{
public string Command => "uploadfolder";
public string Description => Loc.GetString("uploadfolder-command-description");
public string Help => Loc.GetString("uploadfolder-command-help");

private static readonly ResPath BaseUploadFolderPath = new("/UploadFolder");

[Dependency] private IResourceManager _resourceManager = default!;
[Dependency] private IConfigurationManager _configManager = default!;

public async void Execute(IConsoleShell shell, string argStr, string[] args)
{
var fileCount = 0;


if (!_configManager.GetCVar(CCVars.ResourceUploadingEnabled))
{
shell.WriteError( Loc.GetString("uploadfolder-command-resource-upload-disabled"));
return;
}

if (args.Length != 1)
{
shell.WriteError( Loc.GetString("uploadfolder-command-wrong-args"));
shell.WriteLine( Loc.GetString("uploadfolder-command-help"));
return;
}
var folderPath = new ResPath(BaseUploadFolderPath + $"/{args[0]}");

if (!_resourceManager.UserData.Exists(folderPath.ToRootedPath()))
{
shell.WriteError( Loc.GetString("uploadfolder-command-folder-not-found",("folder", folderPath)));
return; // bomb out if the folder doesnt exist in /UploadFolder
}

//Grab all files in specified folder and upload them
foreach (var filepath in _resourceManager.UserData.Find($"{folderPath.ToRelativePath()}/").files )
{

await using var filestream = _resourceManager.UserData.Open(filepath,FileMode.Open);
{
var sizeLimit = _configManager.GetCVar(CCVars.ResourceUploadingLimitMb);
if (sizeLimit > 0f && filestream.Length * SharedNetworkResourceManager.BytesToMegabytes > sizeLimit)
{
shell.WriteError( Loc.GetString("uploadfolder-command-file-too-big", ("filename",filepath), ("sizeLimit",sizeLimit)));
return;
}

var data = filestream.CopyToArray();

var netManager = IoCManager.Resolve<INetManager>();
var msg = netManager.CreateNetMessage<NetworkResourceUploadMessage>();

msg.RelativePath = new ResPath($"{filepath.ToString().Remove(0,14)}"); //removes /UploadFolder/ from path
msg.Data = data;

netManager.ClientSendMessage(msg);
fileCount++;
}
}

shell.WriteLine( Loc.GetString("uploadfolder-command-success",("fileCount",fileCount)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void Initialize()
_netMgr.RegisterNetMessage<MsgUpdateAdminStatus>(UpdateMessageRx);

// Load flags for engine commands, since those don't have the attributes.
if (_res.TryContentFileRead(new ResourcePath("/clientCommandPerms.yml"), out var efs))
if (_res.TryContentFileRead(new ResPath("/clientCommandPerms.yml"), out var efs))
{
_localCommandPermissions.LoadPermissionsFromStream(efs);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void AddAdminVerbs(GetVerbsEvent<Verb> args)
Verb verb = new();
verb.Category = VerbCategory.Debug;
verb.Text = "View Variables";
verb.Icon = new SpriteSpecifier.Texture(new ResourcePath("/Textures/Interface/VerbIcons/vv.svg.192dpi.png"));
verb.Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/vv.svg.192dpi.png"));
verb.Act = () => _clientConsoleHost.ExecuteCommand($"vv {args.Target}");
verb.ClientExclusive = true; // opening VV window is client-side. Don't ask server to run this verb.
args.Verbs.Add(verb);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/Systems/KillSignSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private void KillSignAdded(EntityUid uid, KillSignComponent component, Component

var adj = sprite.Bounds.Height / 2 + ((1.0f/32) * 6.0f);

var layer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResourcePath("Objects/Misc/killsign.rsi"), "sign"));
var layer = sprite.AddLayer(new SpriteSpecifier.Rsi(new ResPath("Objects/Misc/killsign.rsi"), "sign"));
sprite.LayerMapSet(KillSignKey.Key, layer);

sprite.LayerSetOffset(layer, new Vector2(0.0f, adj));
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Administration/UI/AdminAnnounceWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Control HorizontalExpand="True" SizeFlagsStretchRatio="1" />
<OptionButton Name="AnnounceMethod" Access="Public" HorizontalExpand="True" SizeFlagsStretchRatio="2"/>
</BoxContainer>
<LineEdit Name="Announcement" Access="Public" PlaceHolder="{Loc admin-announce-announcement-placeholder}"/>
<TextEdit Name="Announcement" Access="Public" VerticalExpand="True" MinHeight="100" />

<GridContainer Rows="1">
<CheckBox Name="KeepWindowOpen" Access="Public" Text="{Loc 'admin-announce-keep-open'}" />
Expand Down
Loading

0 comments on commit 093e627

Please sign in to comment.