Skip to content

Commit bd21d0a

Browse files
committed
Synapse 2.7.1
1 parent ca8275f commit bd21d0a

24 files changed

+115
-79
lines changed

MoreTools/Commands/Ball.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "Spawns grenades at the player location",
1111
Permission = "moretools.ball",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Ball players (optional amount)"
13+
Usage = "Ball players (optional amount)",
14+
Arguments = new[] { "Players", "(Amount)" }
1415
)]
1516
public class Ball : ISynapseCommand
1617
{

MoreTools/Commands/Broadcast.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "A Command to send a Broadcast to all Players",
1111
Permission = "moretools.bc",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Bc time message"
13+
Usage = "Bc time message",
14+
Arguments = new[] { "Time", "Message" }
1415
)]
1516
public class Broadcast : ISynapseCommand
1617
{

MoreTools/Commands/Flash.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "Spawns flashes at the player location",
1111
Permission = "moretools.flash",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Flash players (optional amount)"
13+
Usage = "Flash players (optional amount)",
14+
Arguments = new[] { "Players", "(Amount)" }
1415
)]
1516
public class Flash : ISynapseCommand
1617
{

MoreTools/Commands/Grenade.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "Spawns grenades at the player location",
1111
Permission = "moretools.grenade",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Grenade players (optional amount)"
13+
Usage = "Grenade players (optional amount)",
14+
Arguments = new[] { "Players", "(Amount)" }
1415
)]
1516
public class Grenade : ISynapseCommand
1617
{

MoreTools/Commands/Hide.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ namespace MoreTools.Commands
99
Description = "A Command to make Players Invisible",
1010
Permission = "moretools.invisible",
1111
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
12-
Usage = "hide players"
12+
Usage = "hide players",
13+
Arguments = new[] { "Players" }
1314
)]
1415
public class Hide : ISynapseCommand
1516
{

MoreTools/Commands/Hint.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "A Command to give all Players a Hint Message",
99
Permission = "moretools.hint",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "hint time message"
11+
Usage = "hint time message",
12+
Arguments = new[] { "Time", "Message" }
1213
)]
1314
public class Hint : ISynapseCommand
1415
{

MoreTools/Commands/Jail.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ namespace MoreTools.Commands
99
Description = "A Command for jailing Players",
1010
Permission = "moretools.jail",
1111
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
12-
Usage = "jail players"
12+
Usage = "jail players",
13+
Arguments = new[] { "Players" }
1314
)]
1415
public class Jail : ISynapseCommand
1516
{

MoreTools/Commands/Nick.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "A Command to change your Nickname",
99
Permission = "moretools.nick",
1010
Platforms = new Platform[] { Platform.ClientConsole },
11-
Usage = ".nick nickname"
11+
Usage = ".nick nickname",
12+
Arguments = new[] { "Nickname" }
1213
)]
1314
public class Nick : ISynapseCommand
1415
{

MoreTools/Commands/Position.cs

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using Synapse.Command;
2+
3+
namespace MoreTools.Commands
4+
{
5+
[CommandInformation(
6+
Name = "position",
7+
Aliases = new string[] { "pos" },
8+
Description = "brings players to a specific position",
9+
Permission = "moretools.pos",
10+
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11+
Usage = "pos players x y z",
12+
Arguments = new[] { "Players", "X Position", "Y Position", "Z Position" }
13+
)]
14+
public class Position : ISynapseCommand
15+
{
16+
public CommandResult Execute(CommandContext context)
17+
{
18+
if (context.Arguments.Count < 4)
19+
return new CommandResult
20+
{
21+
Message = "Missing Parameters! Usage: pos players x y z",
22+
State = CommandResultState.Error
23+
};
24+
25+
if (!Extensions.TryGetPlayers(context.Arguments.FirstElement(), context.Player, out var players))
26+
return new CommandResult
27+
{
28+
Message = "No Player was found",
29+
State = CommandResultState.Error
30+
};
31+
32+
if (!float.TryParse(context.Arguments.At(1), out var x)) return new CommandResult
33+
{
34+
Message = "Invalid Float X",
35+
State = CommandResultState.Error
36+
};
37+
38+
if (!float.TryParse(context.Arguments.At(2), out var y)) return new CommandResult
39+
{
40+
Message = "Invalid Float Y",
41+
State = CommandResultState.Error
42+
};
43+
44+
if (!float.TryParse(context.Arguments.At(3), out var z)) return new CommandResult
45+
{
46+
Message = "Invalid Float Z",
47+
State = CommandResultState.Error
48+
};
49+
50+
foreach (var ply in players)
51+
ply.Position = new UnityEngine.Vector3(x, y, z);
52+
53+
return new CommandResult
54+
{
55+
Message = "All players have been tp't to the position",
56+
State = CommandResultState.Ok
57+
};
58+
}
59+
}
60+
}

MoreTools/Commands/PrivateBroadcast.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "A Command which sends a Broadcast to specific players",
99
Permission = "moretools.pbc",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "pbc players time message"
11+
Usage = "pbc players time message",
12+
Arguments = new[] { "Players", "Time", "Message" }
1213
)]
1314
public class PrivateBroadcast : ISynapseCommand
1415
{

MoreTools/Commands/PrivateHint.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "A Command which sends a hint to specific players",
99
Permission = "moretools.phd",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "phd players time message"
11+
Usage = "phd players time message",
12+
Arguments = new[] { "Players", "Time", "Message"}
1213
)]
1314
public class PrivateHint : ISynapseCommand
1415
{

MoreTools/Commands/RagDoll.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "Spawns Ragdolls",
99
Permission = "moretools.ragdoll",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "Ragdoll player Role Amount"
11+
Usage = "Ragdoll player Role Amount",
12+
Arguments = new[] { "Players", "Role", "Amount" }
1213
)]
1314
public class RagDoll : ISynapseCommand
1415
{
@@ -49,7 +50,7 @@ public CommandResult Execute(CommandContext context)
4950
{
5051
var pos = ply.Position;
5152
pos.y += 2;
52-
new Synapse.Api.Ragdoll((RoleType)role, pos, ply.transform.rotation, UnityEngine.Vector3.zero, new PlayerStats.HitInfo(), false, ply);
53+
new Synapse.Api.Ragdoll((RoleType)role, pos, ply.transform.rotation, UnityEngine.Vector3.zero, new PlayerStats.HitInfo(), false, ply.NickName);
5354
}
5455

5556
return new CommandResult

MoreTools/Commands/Redirect.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "Forces the player to join on a other Server on the same machine with a different port",
99
Permission = "moretools.redirect",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "Redirect players port"
11+
Usage = "Redirect players port",
12+
Arguments = new[] { "Players", "Port"}
1213
)]
1314
public class Redirect : ISynapseCommand
1415
{

MoreTools/Commands/Show.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ namespace MoreTools.Commands
99
Description = "A Command to make Players Visible again",
1010
Permission = "moretools.invisible",
1111
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
12-
Usage = "show players"
12+
Usage = "show players",
13+
Arguments = new[] { "Players" }
1314
)]
1415
public class Show : ISynapseCommand
1516
{

MoreTools/Commands/Size.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "A Command to change the size of Players",
1111
Permission = "moretools.size",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "size players x y z"
13+
Usage = "size players x y z",
14+
Arguments = new[] { "Players", "X Size", "Y Size", "Z Size"}
1415
)]
1516
public class Size : ISynapseCommand
1617
{

MoreTools/Commands/SprintSpeed.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "A Command to change the SprintSpeed of all Players",
1111
Permission = "moretools.sprintspeed",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Walkspeed (speed)"
13+
Usage = "Walkspeed (speed)",
14+
Arguments = new[] { "Speed" }
1415
)]
1516
public class SprintSpeed : ISynapseCommand
1617
{

MoreTools/Commands/Teleport.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "brings players to a specific player",
99
Permission = "moretools.tp",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "tp players player"
11+
Usage = "tp players player",
12+
Arguments = new[] { "Players", "Player" }
1213
)]
1314
public class Teleport : ISynapseCommand
1415
{

MoreTools/Commands/Unjail.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ namespace MoreTools.Commands
99
Description = "A Command for unjailing Players",
1010
Permission = "moretools.jail",
1111
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
12-
Usage = "unjail players"
12+
Usage = "unjail players",
13+
Arguments = new[] { "Players" }
1314
)]
1415
public class UnJail : ISynapseCommand
1516
{

MoreTools/Commands/WalkSpeed.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace MoreTools.Commands
1010
Description = "A Command to change the WalkSpeed of all Players",
1111
Permission = "moretools.walkspeed",
1212
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
13-
Usage = "Walkspeed (speed)"
13+
Usage = "Walkspeed (speed)",
14+
Arguments = new[] { "Speed" }
1415
)]
1516
public class WalkSpeed : ISynapseCommand
1617
{

MoreTools/Commands/Window.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace MoreTools.Commands
88
Description = "Opens the Report Window with a a Custom Message",
99
Permission = "moretools.window",
1010
Platforms = new Platform[] { Platform.RemoteAdmin, Platform.ServerConsole },
11-
Usage = "Window players Message"
11+
Usage = "Window players Message",
12+
Arguments = new[] { "Players", "Message"}
1213
)]
1314
public class Window : ISynapseCommand
1415
{

MoreTools/Extensions.cs

+3-47
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,11 @@
1-
using Synapse;
1+
using System.Collections.Generic;
22
using Synapse.Api;
3-
using System.Collections.Generic;
43

54
namespace MoreTools
65
{
76
public static class Extensions
87
{
9-
public static bool TryGetPlayers(string arg, Player sender, out List<Player> playerList)
10-
{
11-
var players = new List<Player>();
12-
var args = arg.Split('.');
13-
14-
foreach (var parameter in args)
15-
{
16-
if (string.IsNullOrEmpty(parameter)) continue;
17-
if (string.IsNullOrWhiteSpace(parameter)) continue;
18-
19-
switch (parameter.ToUpper())
20-
{
21-
case "ME":
22-
if (!players.Contains(sender))
23-
players.Add(sender);
24-
continue;
25-
26-
case "ADMIN":
27-
case "STAFF":
28-
foreach (var player in Server.Get.Players)
29-
if (player.ServerRoles.RemoteAdmin)
30-
if (!players.Contains(player))
31-
players.Add(player);
32-
continue;
33-
34-
case "*":
35-
case "ALL":
36-
foreach (var player2 in Server.Get.Players)
37-
if (!players.Contains(player2))
38-
players.Add(player2);
39-
continue;
40-
41-
default:
42-
var player3 = Server.Get.GetPlayer(parameter);
43-
if (player3 == null) continue;
44-
if (!players.Contains(player3))
45-
players.Add(player3);
46-
continue;
47-
}
48-
}
49-
50-
playerList = players;
51-
52-
return players.Count != 0;
53-
}
8+
//This was moved into the Synapse API and Im to lazy to change all the references
9+
public static bool TryGetPlayers(string arg, Player sender, out List<Player> playerList) => SynapseController.Server.TryGetPlayers(arg, out playerList, sender);
5410
}
5511
}

MoreTools/MoreTools.csproj

+9-8
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@
3535
<HintPath>..\packages\Lib.Harmony.2.1.1\lib\net472\0Harmony.dll</HintPath>
3636
</Reference>
3737
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\Assembly-CSharp.dll</HintPath>
38+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Assembly-CSharp.dll</HintPath>
3939
</Reference>
4040
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
41-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
41+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Assembly-CSharp-firstpass.dll</HintPath>
4242
</Reference>
4343
<Reference Include="LiteDB, Version=5.0.11.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
4444
<HintPath>..\packages\LiteDB.5.0.11\lib\net45\LiteDB.dll</HintPath>
4545
</Reference>
4646
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\Mirror.dll</HintPath>
47+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Mirror.dll</HintPath>
4848
</Reference>
49-
<Reference Include="Synapse, Version=2.7.0.0, Culture=neutral, processorArchitecture=MSIL">
50-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\Synapse.dll</HintPath>
49+
<Reference Include="Synapse, Version=2.7.1.0, Culture=neutral, processorArchitecture=MSIL">
50+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\Synapse.dll</HintPath>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Core" />
@@ -62,13 +62,13 @@
6262
<Reference Include="System.Net.Http" />
6363
<Reference Include="System.Xml" />
6464
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
65-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.dll</HintPath>
65+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.dll</HintPath>
6666
</Reference>
6767
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
68-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.CoreModule.dll</HintPath>
68+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.CoreModule.dll</HintPath>
6969
</Reference>
7070
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
71-
<HintPath>..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
71+
<HintPath>..\packages\SynapseSL.2.7.1\lib\net472\UnityEngine.PhysicsModule.dll</HintPath>
7272
</Reference>
7373
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
7474
<HintPath>..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
@@ -78,6 +78,7 @@
7878
<Compile Include="Commands\Broadcast.cs" />
7979
<Compile Include="Commands\Ball.cs" />
8080
<Compile Include="Commands\Flash.cs" />
81+
<Compile Include="Commands\Position.cs" />
8182
<Compile Include="Commands\RagDoll.cs" />
8283
<Compile Include="Commands\Redirect.cs" />
8384
<Compile Include="Commands\Window.cs" />

MoreTools/PluginClass.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace MoreTools
88
Description = "A Plugin which adds a ton of Tools and command to the game",
99
LoadPriority = 0,
1010
SynapseMajor = 2,
11-
SynapseMinor = 5,
12-
SynapsePatch = 3,
13-
Version = "v.1.2.1"
11+
SynapseMinor = 7,
12+
SynapsePatch = 1,
13+
Version = "v.1.2.2"
1414
)]
1515
public class PluginClass : AbstractPlugin { }
1616
}

MoreTools/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="Lib.Harmony" version="2.1.1" targetFramework="net472" />
44
<package id="LiteDB" version="5.0.11" targetFramework="net472" />
5-
<package id="SynapseSL" version="2.7.0-dev4" targetFramework="net472" />
5+
<package id="SynapseSL" version="2.7.1" targetFramework="net472" />
66
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
77
<package id="YamlDotNet" version="11.2.1" targetFramework="net472" />
88
</packages>

0 commit comments

Comments
 (0)