This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1.3.5 First commit Adding: `admintoolbox_friendlyfire_damagemultiplier` float config - `admintoolbox_tracking` bool config Fixes: - Code improvements - Fixed warpvectors refrence mistake, closing #51 * 1.3.5 second commit - Replacing all spaces with tabs (because screw spaces) - New Appdata folder structure - Added code to move old server logs to said new folders - Writing player stats (Kills/TeamKills/Deaths) to file, read upon player join - Moved roundcount++ to OnRoundRestart, makes the server start on round 1 * Add KillCommand.cs * 1.3.5 third commit - Player command now can be used with PlayerID, closes #54 - New WarpVector "topsitedoor" by request - Stats writing to file - Intercom speechtime set to 0 (or below) defaults to 5 minutes (300 seconds) * Add ATBAN command - Adding handcuff immunity for godmode players + tutorials - Config to let tutorials be handcuffed * Re-adding Kill/Slay command + fixes * 1.3.5 fourth commit - Added PlayTime to player stats - Added dict clear for missing steamID's with keepsettings off - Added `admintoolbox_roledamageblock_onroundend` , closing #52 - Fixed ATBan spaces which should have been tabs * Updated readme to new 3.1.5 features
- Loading branch information
Showing
35 changed files
with
2,771 additions
and
2,450 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,67 @@ | ||
using System; | ||
using System.IO; | ||
using Smod2; | ||
using Smod2.API; | ||
using Smod2.Commands; | ||
|
||
namespace AdminToolbox.Command | ||
{ | ||
public class ATBanCommand : ICommandHandler | ||
{ | ||
|
||
private Plugin plugin; | ||
|
||
public ATBanCommand(Plugin plugin) | ||
{ | ||
this.plugin = plugin; | ||
} | ||
|
||
public string GetUsage() | ||
{ | ||
return "ATBAN [NAME] [IP/SteamID] [MINUTES]"; | ||
} | ||
|
||
public string GetCommandDescription() | ||
{ | ||
return "Alternative ban for offline users"; | ||
} | ||
|
||
public string[] OnCall(ICommandSender sender, string[] args) | ||
{ | ||
try | ||
{ | ||
if (args.Length != 3) return new string[] { GetUsage() }; | ||
string ipBanPath = FileManager.AppFolder + "IpBans.txt"; | ||
string sidBanPath = FileManager.AppFolder + "SteamIdBans.txt"; | ||
string outs = ""; | ||
string IssuingPlayer = (sender is Player pl && !string.IsNullOrEmpty(pl.SteamId)) ? pl.Name : "Server"; | ||
DateTime bannedTime; ; | ||
if (double.TryParse(args[2], out var minutes)) | ||
bannedTime = DateTime.Now.AddMinutes(minutes); | ||
else | ||
return new string[] { "Wrong time format: " + args[2] }; | ||
|
||
if (args[1].Contains(".")) | ||
{ | ||
if (args[1].Split('.').Length != 4) return new string[] { "Invalid IP: " + args[1] }; | ||
string ip = (args[1].Contains("::ffff:")) ? args[1] : "::ffff:" + args[1]; | ||
outs += args[0] + ";" + ip + ";" + bannedTime.Ticks + ";;" + IssuingPlayer + ";" + DateTime.Now.Ticks; | ||
File.AppendAllText(ipBanPath, "\n" + outs); | ||
if (IssuingPlayer != "Server") plugin.Info("Player with name: " + args[0] + " and with IP: " + args[1] + " was banned for " + args[2] + " minutes by " + IssuingPlayer); | ||
return new string[] { "Player with name: " + args[0] + " and with IP: " + args[1] + " was banned for " + args[2] + " minutes by " + IssuingPlayer }; | ||
} | ||
else | ||
{ | ||
outs += args[0] + ";" + args[1] + ";" + bannedTime.Ticks + ";;" + IssuingPlayer + ";" + DateTime.Now.Ticks; | ||
File.AppendAllText(sidBanPath, "\n" + outs); | ||
if (IssuingPlayer != "Server") plugin.Info("Player with name: " + args[0] + " and with SteamID: " + args[1] + " was banned for " + args[2] + " minutes by " + IssuingPlayer); | ||
return new string[] { "Player with name: " + args[0] + " and with SteamID: " + args[1] + " was banned for " + args[2] + " minutes by " + IssuingPlayer }; | ||
} | ||
} | ||
catch (Exception e) | ||
{ | ||
return new string[] { e.StackTrace }; | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.