Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various changes: Fixing namespace and some additions to Player.cs #201

Open
wants to merge 5 commits into
base: 13.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions NwPluginAPI/Commands/CommandsManager.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace PluginAPI.Commands
{
using System;
using System.Collections.Generic;
using System.Linq;
using CommandSystem;
using PluginAPI.Core;
using RemoteAdmin;
using System;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Manages commands.
Expand Down
4 changes: 2 additions & 2 deletions NwPluginAPI/Commands/ListCommand.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace PluginAPI.Commands
{
using System;
using System.Collections.Generic;
using CommandSystem;
using Loader;
using System;
using System.Collections.Generic;

/// <summary>
/// Lists all plugins on the server.
Expand Down
40 changes: 20 additions & 20 deletions NwPluginAPI/Commands/ReloadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
switch (arguments.At(0).ToLowerInvariant())
{
case "plugins":
{
var plugins = new List<string>();

foreach (var plugin in AssemblyLoader.InstalledPlugins)
{
plugin.ReloadConfig(plugin);
plugins.Add($"<color=lime>{plugin.PluginName}</color>");
}
var plugins = new List<string>();

response =
$"{(plugins.Count == 0 ? "Reloaded 0 plugin configs!" : $"Reloaded {string.Join(", ", plugins)} plugin configs!")}";
return true;
}
foreach (var plugin in AssemblyLoader.InstalledPlugins)
{
plugin.ReloadConfig(plugin);
plugins.Add($"<color=lime>{plugin.PluginName}</color>");
}

response =
$"{(plugins.Count == 0 ? "Reloaded 0 plugin configs!" : $"Reloaded {string.Join(", ", plugins)} plugin configs!")}";
return true;
}
case "gameplay":
{
GameCore.ConfigFile.ReloadGameConfigs();
response = $"config_gameplay successfully reloaded";
return true;
}
{
GameCore.ConfigFile.ReloadGameConfigs();
response = $"config_gameplay successfully reloaded";
return true;
}
default:
{
response = $"Please specify a valid argument\nUsage: plugins reload {this.DisplayCommandUsage()}";
return false;
}
{
response = $"Please specify a valid argument\nUsage: plugins reload {this.DisplayCommandUsage()}";
return false;
}
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions NwPluginAPI/Core/Cassie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace PluginAPI.Core
/// </summary>
public static class Cassie
{
#region Static Parameters
#region Static Parameters

/// <summary>
/// Gets whether or not CASSIE is speaking.
Expand All @@ -24,11 +24,11 @@ public static class Cassie
/// </summary>
public static IEnumerable<VoiceLine> VoiceLines => singleton.voiceLines;

#endregion
#endregion

#region Static Methods
#region Static Methods

#region Sending messages.
#region Sending messages.

/// <summary>
/// Send CASSIE message without glitch phrases.
Expand All @@ -47,14 +47,14 @@ public static class Cassie
/// <param name="jamChance">The chance of jamming each word.</param>
public static void GlitchyMessage(string message, float glitchChance, float jamChance) => singleton.ServerOnlyAddGlitchyPhrase(message, glitchChance, jamChance);

#endregion
#endregion

/// <summary>
/// Clears all CASSIE messages in queue.
/// </summary>
public static void Clear() => RespawnEffectsController.ClearQueue();

#region Utils.
#region Utils.

/// <summary>
/// Calculates duration of a CASSIE message.
Expand Down Expand Up @@ -82,7 +82,7 @@ public static class Cassie
/// <param name="word">The word.</param>
public static bool IsValid(string word) => singleton.voiceLines.Any(line => line.apiName.ToUpper() == word.ToUpper());

#endregion
#endregion

/// <summary>
/// Forces an scp termination announcement.
Expand All @@ -92,6 +92,6 @@ public static class Cassie
public static void ScpTermination(Player player, DamageHandlerBase info)
=> AnnounceScpTermination(player.ReferenceHub, info);

#endregion
#endregion
}
}
4 changes: 2 additions & 2 deletions NwPluginAPI/Core/Doors/FacilityBreakableDoor.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace PluginAPI.Core.Doors
{
using Core;
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
using Core;
using Zones;
using System.Collections.Generic;
using System.Linq;
using Zones;

/// <summary>
/// Represents a breakable door.
Expand Down
6 changes: 3 additions & 3 deletions NwPluginAPI/Core/Doors/FacilityDoor.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace PluginAPI.Core.Doors
{
using System.Linq;
using Core;
using Interactables.Interobjects.DoorUtils;
using MapGeneration;
using Core;
using Zones;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Zones;

/// <summary>
/// Represents a door.
Expand Down
4 changes: 2 additions & 2 deletions NwPluginAPI/Core/Doors/FacilityGate.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace PluginAPI.Core.Doors
{
using Interactables.Interobjects;
using Core;
using Zones;
using Interactables.Interobjects;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Zones;

/// <summary>
/// Represents a gate.
Expand Down
4 changes: 3 additions & 1 deletion NwPluginAPI/Core/Extensions/PlayerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace PluginAPI.Core
namespace PluginAPI.Core.Extensions
{
using InventorySystem.Configs;

Expand All @@ -20,5 +20,7 @@ public static class PlayerExtensions
/// <param name="category">The item category.</param>
/// <returns>Maximum amount of items which player can hold.</returns>
public static int GetCategoryLimit(this Player plr, ItemCategory category) => InventoryLimits.GetCategoryLimit(category, plr.ReferenceHub);


}
}
4 changes: 2 additions & 2 deletions NwPluginAPI/Core/Facility.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace PluginAPI.Core
{
using Doors;
using Interactables.Interobjects;
using Interactables.Interobjects.DoorUtils;
using MapGeneration;
using Doors;
using Zones;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Zones;
using FacilityZone = Zones.FacilityZone;

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions NwPluginAPI/Core/FactoryManager.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace PluginAPI.Core
{
using Events;
using Factories;
using System;
using System.Collections.Generic;
using Factories;
using Events;

/// <summary>
/// Manages factories for plugin system.
Expand Down
2 changes: 1 addition & 1 deletion NwPluginAPI/Core/Items/Item.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace PluginAPI.Core.Items
{
using InventorySystem.Items;
using Core;
using InventorySystem.Items;
using System.Collections.Generic;
using UnityEngine;

Expand Down
2 changes: 1 addition & 1 deletion NwPluginAPI/Core/Items/ItemPickup.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace PluginAPI.Core.Items
{
using Core;
using InventorySystem;
using InventorySystem.Items;
using InventorySystem.Items.Pickups;
using Mirror;
using Core;
using System.Collections.Generic;
using UnityEngine;

Expand Down
4 changes: 2 additions & 2 deletions NwPluginAPI/Core/Log.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace PluginAPI.Core
{
using System;
using System.Reflection;
using Enums;
using GameCore;
using PluginAPI.Loader;
using System;
using System.Reflection;

/// <summary>
/// Logger for plugin system.
Expand Down
8 changes: 4 additions & 4 deletions NwPluginAPI/Core/Map.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using MapGeneration;
using System.Collections.Generic;
using System.Linq;
using Interactables.Interobjects;
using LightContainmentZoneDecontamination;
using MapGeneration;
using MapGeneration.Distributors;
using PlayerRoles.PlayableScps.Scp079.Cameras;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using Color = UnityEngine.Color;

Expand Down Expand Up @@ -141,7 +141,7 @@ public static void FlickerLights(float duration, FacilityZone zone)

foreach (var controller in RoomLightController.Instances)
{
if(controller.Room.Zone == zone)
if (controller.Room.Zone == zone)
controller.ServerFlickerLights(duration);
}
}
Expand Down
Loading