Commit graph

185 commits

Author SHA1 Message Date
SGKoishi
6ee22758c1
Merge remote-tracking branch 'upstream/general-devel' into patch-1 2025-01-25 08:05:35 -08:00
Stargazing Koishi
10aca8573d
Remove Connection: Close for REST api
fix #2923
2023-03-07 18:39:38 -08: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
Lucas Nicodemus
9c748abda8 Minor: add h, this commit is worthless, do not read
Told you.
2021-06-19 01:08:55 -07:00
Lucas Nicodemus
eb97bdd259 Add helpful note to rest rate-limit error
The rate limiting error message used the term "tokens," which could be
easily misconstrued to refer to REST auth tokens, and not rate limit
leaky-bucket tokens. Since we don't expose the internals of the leaky
bucket to end-users, this error message is essentially just not good.
Without knowledge of a leaky bucket/GCRA, it really makes no sense.

Therefore, this changes the message to indicate that the "tokens" are
rate-limit tokens. It also adds a hint that there's a config setting
that can be changed to raise the limit, which further makes it more
understandable, and also provides a reasonable hint as to what setting
to change to alleviate this problem immediately. This makes it easier
for users to debug and less likely they have to read old docs/wait for help.
2021-06-19 01:04:00 -07:00
Chris
d92bfc0f65
Merge branch 'general-devel' into rest-permissions 2021-04-22 16:52:55 +09:30
Chris
32a0e2f1b6 Resolve /v2/players/list generating a stack overflow 2021-04-13 13:06:18 +09:30
Bambino
d1687b7ad0 Fix REST Server Broadcast description try #2. One too many 'cans'. 2021-02-08 12:37:56 -06:00
Bambino
3a8ea49823 Fixed server broadcast permission description. 2021-02-08 08:16:14 -06: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
1b4dc5361c Set REST response status to statuses defined by returned REST objects
Closes #2189
2020-12-23 00:26:18 +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
656c9afdb2 Remove obsolete Rest event. 2017-12-26 20:03:36 -07:00
Lucas Nicodemus
c2fe96921e Turn off XML comment warnings in REST Permissions 2017-12-23 09:39:59 -07:00
Lucas Nicodemus
3a59280834 Pre-initialize TShock hooks for Register method
Hooks have this fancy .Register method when they're of type
HandlerList<Args> that high made but we never bother to initialize
any of them, so .Register doesn't work because it's null.

This solves that problem by just initializing all handlers. Thus,
.Register works, and thus, you can register hooks with priorities.
2017-12-20 12:35:42 -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
White
9d4ced58b9 Remove an oversight relating to REST token management 2017-02-02 00:23:12 +10:30
White
26010c0acf Updated REST to use an RNGCryptoServiceProvider for more secure random numbers involved in token generation.
Also removes some unnecessary limitations.
Closes #1388
2017-01-31 11:25:59 +10:30
White
fe670bc18f Fix for null reference exceptions from REST 2017-01-11 19:42:38 +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