This repository has been archived by the owner on Sep 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from SynapseSL/development
v.1.2.0
- Loading branch information
Showing
27 changed files
with
500 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using CommandSystem; | ||
using Synapse.Api; | ||
using System; | ||
using System.Linq; | ||
using UnityEngine; | ||
|
||
namespace Synapse.Commands | ||
{ | ||
[CommandHandler(typeof(ClientCommandHandler))] | ||
public class KeyPressCommand : ICommand | ||
{ | ||
public string Command { get; } = "keypress"; | ||
|
||
public string[] Aliases { get; } = new string[] | ||
{ | ||
"kp", | ||
"key", | ||
"keybind" | ||
}; | ||
|
||
public string Description { get; } = "A Command for the KeyPressEvent from Synapse!"; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string respone) | ||
{ | ||
if (sender.GetPlayer() == Server.Host) | ||
{ | ||
respone = "Nope the Console cant use this!"; | ||
return false; | ||
} | ||
|
||
if (arguments.Count < 1) | ||
{ | ||
respone = "Use .key sync in order to sync your binds and use all Features of the Plugins!"; | ||
return false; | ||
} | ||
|
||
switch (arguments.FirstOrDefault().ToUpper()) | ||
{ | ||
case "SYNC": | ||
var component = sender.GetPlayer().ClassManager; | ||
foreach(var key in (KeyCode[])Enum.GetValues(typeof(KeyCode))) | ||
component.TargetChangeCmdBinding(component.connectionToClient, key, $".key send {(int)key}"); | ||
|
||
respone = "All Keys was synced!"; | ||
return true; | ||
|
||
case "SEND": | ||
if(!Enum.TryParse<KeyCode>(arguments.ElementAt(1), out var key2)) | ||
{ | ||
respone = "Invalid KeyBind! If they are binded by Synapse please report this!"; | ||
return false; | ||
} | ||
|
||
try | ||
{ | ||
Events.Events.InvokeKeyPressEvent(sender.GetPlayer(), key2); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error($"KeyPressEvent Error: {e} "); | ||
} | ||
respone = "Key was accepted"; | ||
return true; | ||
default: | ||
respone = "Use .key sync in order to sync your binds and use all Features of the Plugins!"; | ||
return false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using CommandSystem; | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Synapse.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
[CommandHandler(typeof(GameConsoleCommandHandler))] | ||
[CommandHandler(typeof(ClientCommandHandler))] | ||
public class PluginInfoCommand : ICommand | ||
{ | ||
public string Command { get; } = "plugin"; | ||
|
||
public string[] Aliases { get; } = new string[] | ||
{ | ||
"plugininfo", | ||
"pi" | ||
}; | ||
|
||
public string Description { get; } = "Gives you Informations about a Plugin"; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string respone) | ||
{ | ||
if (arguments.Count < 1) | ||
{ | ||
respone = "You also have to enter a plugin name: plugin ExamplePlugin"; | ||
return false; | ||
} | ||
|
||
foreach(var plugin in Synapse.Plugins) | ||
if (plugin.Name.ToLower().Contains(arguments.FirstOrDefault().ToLower())) | ||
{ | ||
respone = $"The Plugin {plugin.Name} Version {plugin.Version} was created by {plugin.Author} and was made for Synapse v.{plugin.SynapseMajor}.{plugin.SynapseMinor}.{plugin.SynapsePatch}" + | ||
$"\nPlugin Description: {plugin.Description}"; | ||
return true; | ||
} | ||
|
||
respone = "No Plugin with such a name was found!"; | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using CommandSystem; | ||
using System; | ||
|
||
namespace Synapse.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
[CommandHandler(typeof(GameConsoleCommandHandler))] | ||
[CommandHandler(typeof(ClientCommandHandler))] | ||
public class PluginsCommand : ICommand | ||
{ | ||
public string Command { get; } = "plugins"; | ||
|
||
public string[] Aliases { get; } = new string[] | ||
{ | ||
"pl", | ||
}; | ||
|
||
public string Description { get; } = "Gives you all Plugins installed on the Server"; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string respone) | ||
{ | ||
var msg = "\nAll Plugins:"; | ||
foreach(var plugin in Synapse.Plugins) | ||
{ | ||
msg += $"\n{plugin.Name} Version: {plugin.Version} by {plugin.Author}"; | ||
} | ||
|
||
respone = msg; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using CommandSystem; | ||
using Synapse.Api; | ||
using Synapse.Config; | ||
using System; | ||
|
||
namespace Synapse.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
public class ReloadConfigsCommand : ICommand | ||
{ | ||
public string Command { get; } = "reloadconfigs"; | ||
|
||
public string[] Aliases { get; } = new string[] | ||
{ | ||
"rc", | ||
"reloadc" | ||
}; | ||
|
||
public string Description { get; } = "A Command to Relaod the Configs of Synapse"; | ||
|
||
public bool Execute(ArraySegment<string> arguments,ICommandSender sender,out string respone) | ||
{ | ||
if (!sender.GetPlayer().CheckPermission("sy.reload.configs")) | ||
{ | ||
respone = "You have no Permission for Reload Configs"; | ||
return false; | ||
} | ||
|
||
ConfigManager.ReloadAllConfigs(); | ||
respone = "Configs Reloaded!"; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using CommandSystem; | ||
using Synapse.Api; | ||
using Synapse.Config; | ||
using System; | ||
|
||
namespace Synapse.Commands | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
public class ReloadPermissionsCommand : ICommand | ||
{ | ||
public string Command { get; } = "reloadpermissions"; | ||
|
||
public string[] Aliases { get; } = new string[] | ||
{ | ||
"rp", | ||
"reloadp" | ||
}; | ||
|
||
public string Description { get; } = "A Command to Relaod the Permissions of Synapse"; | ||
|
||
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string respone) | ||
{ | ||
if (!sender.GetPlayer().CheckPermission("sy.reload.permission")) | ||
{ | ||
respone = "You have no Permission for Reload Permissions"; | ||
return false; | ||
} | ||
|
||
PermissionReader.ReloadPermission(); | ||
respone = "Permissions Reloaded!"; | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.