Commit graph

142 commits

Author SHA1 Message Date
Lucas Nicodemus
4cab985d0f
Merge branch 'general-devel' into accountgroupcupdate-hook 2025-01-26 12:59:15 +09:00
AkjaHAsLk1IALk0MasH
230d9b0945 Updated the SetUserGroup in the commands. 2023-05-14 12:17:47 +07:00
SGKoishi
59f9440d17
Use same TSPlayer.Active check 2022-12-12 17:15:34 -08:00
SGKoishi
fde43a7730
More i18n
Strings for player kick/ban, anti-cheating and server logs
2022-11-02 13:42:52 -07:00
SGKoishi
ea9f6b73e0
Update some i18n source text 2022-10-24 12:51:08 -07:00
Janet Blackquill
f63b26ac76 Some i18nifiying 2022-10-21 16:12:04 -04:00
Lucas Nicodemus
adbca6a99b
Modernize REST field dumper
Dumps to markdown, formatted for docsify instead of readme.io, and also
puts it in the right folder.
2022-10-19 00:46:02 -07:00
Killia0
154bee58f1 Typo fixes on comments/strings
My first PR contribution to TShock is spellcheck huh, frankly I don't know why but hey I could spare the time for this and caught some stuff.
2021-07-16 14:53:37 -04:00
Bambino
60464a890d Permission added to REST Server Broadcast . 2021-02-08 05:05:31 -06:00
Chris
51f179f84a Added URI-unescaping for inputs into REST requests 2020-12-23 01:46:42 +10:30
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
29170e62a6 Rename unique ID -> ticket number
Also get ban conversion to execute cleanly and clean up after itself
2020-11-29 15:17:49 +10:30
Chris
cde4cc5f04 Ban rewrite and various other adjustments 2020-11-26 17:20:19 +10:30
Chris
56de9f6684 Ban rewrite 2020-11-15 11:05:04 +10:30
Chris
b9b83dd36f Resolve null reference on REST user group name. Solves #1850 2020-05-22 14:41:52 +09:30
Lucas Nicodemus
70dd72443d Update copyright to 2019 again
Fixes #1658, most likely.
2019-03-29 17:16:37 -07:00
Lucas Nicodemus
569b350cea Update to Pryaxis, 2018 part 2
If there's one thing I learned in this exercise, it's that letting
people add random python scripts to the repo like gpltext.py that
promise to be easier than find and replace is a bad idea.
2018-01-01 02:20:56 -07:00
Lucas Nicodemus
332e6b2518 Remove Utils.GetGroup().
This method duplicates Groups.GetGroupByName().
2017-12-29 08:45:29 -07:00
Lucas Nicodemus
afdedee1c4 Change Utils.Reload to not take a player.
There are two occasions in the codebase when Utils.Reload is called and
we're competent enough that we can just call the event when the reload
happens. Unrelated note, but shouldn't this event be called prior to
reloading? I've kept it the same to preserve existing behavior, but I
think it should probably happen before the reload event takes place.

Either way, I think this is fine.
2017-12-29 08:04:20 -07:00
Lucas Nicodemus
70c8ef548f Fix merge conflict part 2 2017-12-27 19:09:08 -07:00
Lucas Nicodemus
f74a0f6a70 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:03:03 -07:00
Lucas Nicodemus
1ea04ffd4f Remove Utils.ForceKick; use TSPlayer.Kick.
Some anti-cheat calls were changed to "You have been Bounced." I don't
think we need to tell clients why they were disconnected so they can
tune their hacks better.
2017-12-27 18:01:53 -07:00
Lucas Nicodemus
11920cde48 Move Utils.FindPlayer -> TSPlayer.FindByNameOrID.
This makes TShock more OOP like (get the matching players from the
player as opposed to getting the players from a random class that
shouldn't exist).
2017-12-26 20:53:00 -07:00
Lucas Nicodemus
903bd5bb75 Migrate AddBan2 calls to AddBan
No more deprecation warnings on this release #yolo
2017-12-26 20:05:52 -07:00
Lucas Nicodemus
69eda3d38e Remove server restart rest routes 2017-12-11 16:09:03 -07:00
Edgar Luque
5c24ba6f8d missed UserAccount declarations 2017-12-08 01:43:13 +01:00
Edgar Luque
6589531868 Renamed TShockAPI.DB 'User' to 'UserAccount' 2017-12-08 01:38:15 +01:00
Lucas Nicodemus
718525904a Add remaining backbone for banning accounts (sort of)
Frontend still doesn't work properly. In particular:

1. Need a way to list bans by account name.
2. Need a way to unban by account name.
3. Really need a way to change the IP on a ban lol.

Ban system still needs to be be rebuilt fully, but at least this
doesn't necessarily character ban someone if you were going for an IP
ban.

Fixes #1412
2017-12-02 20:41:14 -07:00
Lucas Nicodemus
983a678ff3 Fix issue 1467 - Password is now hashed when adding a user via REST API 2017-07-15 13:32:27 -06:00
White
72a547441b Redirects /token/create to /v2/token/create.
Adds /v4/players/read. V4 contains piggy, safe, and forge data, and condenses all item fields into one object with child objects.
2017-05-02 16:53:59 +09:30
Lucas Nicodemus
b8dbdb9ff4
Final batch of .name changes 2017-04-19 17:41:15 -06:00
Ruby Rose
787e5e0108 Update RestManager.cs 2017-03-19 19:52:20 +02:00
Ruby Rose
3dac79fcc6 Expand rest info 2017-03-19 20:49:48 +03:00
White
c4a3a9fb67 Updated Copyright for 2017 2017-03-13 12:17:16 +10:30
White
ea1d3c818f Fixed a typo in /v3/world/bloodmoon
Because apparently bloomoons aren't a thing.
Fixes #1401
2017-02-20 16:09:31 +10:30
White
e3a8112b5b REST updates.
Rest.cs got a lot of commenting at last.
Redirects and upgrades can now be easily added for REST routes via the `Rest.RegisterRedirect(base, target, upgrade)` method.
Redirects added for all routes. Upgrades added for `/world/bloodmoon` and `/v2/world/autosave`, as they both use old-style REST verbs.
2017-02-02 14:28:35 +10:30
Lucas Nicodemus
f264e2b060
Add parity in REST /world/meteor with /dropmeteor functionality
See #1361

It looks like we're setting spawnMeteor before executing WorldGen.dropMeteor()
in the command but not in the REST API. This makes the two code paths
behave the same.
2017-01-10 13:17:31 -07:00
White
24da389050 Re-added /status and added mute bool to /v3/players/read.
`/status` is now a root endpoint and will always point to `/v2/server/status` with an added `upgrade` field describing the route to the latest status endpoint.
Closes #1358. Closes #1348
2016-12-31 11:55:10 +10:30
Zaicon Kiroshu
50d8b0db30 1.3.4.3 Update (API 1.26) 2016-11-19 17:05:08 -06:00
Lucas Nicodemus
1328d71fdc Merge pull request #1317 from DogooFalchion/motd
Update MotD file parsing to convert color formats into smart text.
2016-10-23 19:27:52 -06:00
White
6151c86630 Removed the old REST model.
This includes the following endpoints:
* `/status`
* `/v2/players/read`
* `/v2/server/rawcmd`
2016-10-23 21:52:25 +10:30
DogooFalchion
a2003f130b Do not append Tshock to the MotD path. 2016-10-22 19:03:32 -04:00
DogooFalchion
6242a54603 Update references to MOTD to point to the variable, instead of having magic strings. 2016-10-22 17:37:00 -04:00
Adilson Carvalho
49b4effe74 Changed year to 2016 on all GPL headers 2016-10-16 17:06:02 -02:00
Lucas Nicodemus
f8039c8f80 Rest API uses 'permissions' on /v2/groups/update
Arguably this should be a change to a new API version, but the
current functionality is broken so this just kinda fixes that.

Fixes #1292
2016-10-05 08:28:01 -06:00
ProfessorXZ
05a4e025f7 Added the Registered property to REST's players/read endpoints 2016-08-30 09:16:01 +02:00
George
09a8f95a70 Added rate limiting to RESTful API
Added token bucket and timer to degrade token bucket

Modified REST API rate limiting

Changed limiting to only be on token create and v2 token create
Added config options to choose time limits
Passed HttpContext to the execute method of endpoints

Made blocking failed API logins optional

Changed error codes on failed login to be ambiguous
Added config to decide whether all or failed logins are limited

Changed config variable names

Cleaned up duplicate code in REST rate limiting

Fixed my typo

Changed error 431 to 403
2015-09-24 15:47:46 +01:00
Enerdy
597322217d Fix more broken calls. 2015-07-04 16:17:31 +01:00
White
dd7ad78d3f Adds a User object to TSPlayer 2015-04-29 17:24:20 +09:30
Lucas Nicodemus
6fe33b5c43 /v2/groups/create uses non-deprecated AddGroup call
This should have no functional change that's negative. The previous
method only returned errors based on exceptions, so switching does
nothing except remove deprecated code.
2015-04-13 00:04:59 -06:00