Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

ATBAN reason parameter is broken, cannot handle spaces #84

Closed
PatPeter opened this issue Mar 25, 2019 · 2 comments · Fixed by #109
Closed

ATBAN reason parameter is broken, cannot handle spaces #84

PatPeter opened this issue Mar 25, 2019 · 2 comments · Fixed by #109
Labels
bug Something isn't working fixed for next release Evan did a doo, but fixed it for the next update

Comments

@PatPeter
Copy link

PatPeter commented Mar 25, 2019

Version (please complete the following information):

  • Smod Version: 3.2.2
  • AdminToolbox Version: 1.3.8-5

Describe the bug

I typed the following on my server:

atban PatPeter 76561297984998697 1440 "He's a badmin"

It resulted in the following ban line:

PatPeter;76561297984998697;636891604550120450;"He's;|UGA|PatPeter;636890740550120450

To Reproduce

Steps to reproduce the behavior:

  1. Type atban YourName SteamID 1440 "Reason in quotes here"
  2. Open SteamIdBans.txt and scroll to the bottom.
  3. You will not see the entire reason for your ban.

Expected behavior

The ban file should contain the ban reason with spaces.

Additional text

Here's the code I use in my callvote plugin to get quoted command parameters without the command itself.

					string[] quotedArgs = Regex.Matches(string.Join(" ", ev.Command), "[^\\s\"\']+|\"([^\"]*)\"|\'([^\']*)\'")
						.Cast<Match>()
						.Select(m => m.Value)
						.ToArray()
						.Skip(1)
						.ToArray();

However, this code does not remove the quotations so you'll have to do a trim on the result.

@Rnen
Copy link
Owner

Rnen commented Mar 25, 2019

Yeah... that would be me doing an oopsie
image

While its supposed to be
image

@Rnen
Copy link
Owner

Rnen commented Mar 25, 2019

Or actually, this should properly do it
image

@Rnen Rnen added bug Something isn't working fixed for next release Evan did a doo, but fixed it for the next update labels Mar 25, 2019
Rnen added a commit that referenced this issue Mar 25, 2019
 - Closes #84
 - Made Command take 1 less arg, defaults time to config `admintoolbox_atban_duration_default` (default 1 month)
@Rnen Rnen closed this as completed in #109 Jul 22, 2020
Rnen added a commit that referenced this issue Mar 7, 2022
* Huge ass commit featuring loads of stuff

 - Add static commandaliases to all command classes
 - Move IsInsideJail & JailedPlayers list to ExentionMethods
 - New PlayerFile storage format, including new serializable classes
 - New Utility class with utilitary Methods
 - Minor optimizations

* 1.3.8-5

 - Fixed Enumerator errors on changed collection OnRoundEnd / OnRoundRestart
 - Fixed WarpPoint serialization crash
 - Fixed `admintoolbox_logremover_hours_old` not working at all (also changed default from 48 hours to disabled)
 - New static system for getting AT related folder paths
 - General cleanup

* Fixed ATBAN not handling additional args

 - Closes #84
 - Made Command take 1 less arg, defaults time to config `admintoolbox_atban_duration_default` (default 1 month)

* 1.3.9 Part 1 (unfinished)

* Added LockDoors command, removed excess code

This closes #87

* Ban-Webhook stuff, Tutorial command changes, Empty command rework, WaitForTeleport class

- New Ban-Wehbook `admintoolbox_ban_webhooks` list config & `admintoolbox_ban_webhook_onkick` bool config
- Trying something new with the EMPTY command, might be broken
- Made TUTORIALS teleport to an existing `tutorial` warppoint if the command is used in SPECTATOR mode

* Updated dummy wehbook variables

* Fixed webhook duration display

* Added RespawnLock

closes #89

* 1.3.9 Final?

- Cleanup
- More Cleanup
- Change remaining ContainsKey to TryGetValue
- Remove unused/unfinished feature
- More XML

* Add new Master branch files (#94)

* Create FUNDING.yml

* 1.3.9 Final Final?

- ClosestDoor command
- GrenadeMode command
- InfiniteItem command
- `admintoolbox_warps_remove_underground` config
- Formatting fixes and cleanup

* Switchng to Unity JSON System

* Fix csproj error

* Apparently Unity JSON doesn't like arrays

* Bump version

* Updated to SMod 3.6.0

* Removed startup info

- SMod PluginManager does this automatically now

* Added more debug

* Updated to SMod 3.7.0-A (Ish)

* Update to Pre-release 4

- Removed enum

* Framework update for Smod Beta

* 13.8-16 Updated to Scopophobia

* Updated for SMod 3.8.2

* Remove obsolete code

* New AT Sub-commands

- Webhook test command
- Room ID command

* Minor MiscEvents cleanup and failsafes

* Replace Newtonsoft with UTF8Json, rename ATFileManager

- Reworked JSON stuff to use UTF8Json that comes with the game
- Renamed the class ATFileManager to ATFile (Its under the Manager Namespace anyways)

* Version bump

* Added SMod version to AT INFO command

* Webhook update, new config, version bump

- Updated Webhooks to now send bytes instead of text
- Added `admintoolbox_ban_console_info` bool config (default true). Outputs info into server console on player ban
- Updated the ban webhook layout, added timespan display and replaced missing picture
- Moved the WebHook assembling to a static Utility method

* Update to SMod 3.9.0, Rename ATFileManager

* Cleaning up, version bump

- Moved a lot of stuff out of the main plugin class, renamed some things for consistency

* "Copy local" is stupid.

* Structs are cool.

* More structs

* UTC Time, Struct, Renaming, new Method,

- Updated to use DateTime UTC instead of NOW
- Renamed several things to be more intuitive
- Added some Try-Catch'es (ATFile, ExtentionMethods, GetPlayerFromString)
- Made the WarpPoint class into a Struct
- Better static JailPos property
- Added TryGetPlayer method
- Made the class GetPlayerFromString static

* Remove Unused stuff, update enums

* ATfile updates, adapt to SMod API changes, version bump

* Added "blank" playerfilename check to file save ,Changed Info messages to Debug

Some messages that was meant to be debug in the first place 💩

* Updated Utility enum

* Version bump

* Rename GetPlayerFromString

* Added more methods to GetFromString

* Update to Karl's SMod update (#121)

* Update to Karl's SMod update

* Remove obolete event stuff

* Update for SMod 3.10.0 release

* Update to AT 1.3.9

*Time to finally get out of this revision-hell*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed for next release Evan did a doo, but fixed it for the next update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants