Merge pull request #1624 from Pryaxis/fix-time

Allow time parser to take spaces
This commit is contained in:
Chris 2018-05-29 02:36:45 +00:00 committed by GitHub
commit 1995161b5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -84,6 +84,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Fixed erroneous kicks and bans when using `KickOnMediumcoreDeath` and `BanOnMediumcoreDeath` options. (@DankRank)
* Removed `TSPlayer.InitSpawn` field. (@DankRank)
* `OnPlayerSpawn`'s player ID field is now `PlayerId`. (@DankRank)
* `Utils.TryParseTime` can now take spaces (e.g., `3d 5h 2m 3s`) (@QuiCM)
* Enabled banning unregistered users (@QuiCM)
* Added filtering and validation on packet 96 (Teleport player through portal) (@QuiCM)

View file

@ -534,7 +534,7 @@ namespace TShockAPI
var sb = new StringBuilder(3);
for (int i = 0; i < str.Length; i++)
{
if (Char.IsDigit(str[i]) || (str[i] == '-' || str[i] == '+'))
if (Char.IsDigit(str[i]) || (str[i] == '-' || str[i] == '+' || str[i] == ' '))
sb.Append(str[i]);
else
{