Commit graph

228 commits

Author SHA1 Message Date
SGKoishi
59f9440d17
Use same TSPlayer.Active check 2022-12-12 17:15:34 -08:00
SGKoishi
b57d02094f
Fix Utils.GetByName add duplicate candidate for same target i18n 2022-11-27 22:30:40 -08:00
SGKoishi
fb96d8b0c8
Merge upstream 2022-11-10 00:09:40 -08:00
Lucas Nicodemus
b322c4c1e0
Replace references to Main.max*whatever*count
All of the Main.maxwhatever fields have been replaced with
Terraria.ID.WhateverID.Count fields.
2022-11-09 22:53:29 -08:00
SGKoishi
1ee8058776
Use same logic for all GetByNameOrId
NPC, Item, Prefix, Buff
2022-11-02 14:40:59 -07:00
Lucas Nicodemus
eae8ae1fb5
Merge branch 'general-devel' into patch-3 2022-10-27 15:49:53 -06:00
yuyu
dfbf2b3b3c Update permissions reference 2022-10-26 22:17:25 +08:00
SGKoishi
b766e045b5
Use i18n for most string.Format if shown in log, console or client side 2022-10-24 13:38:33 -07:00
Lucas Nicodemus
fa9717debf
Change dumper to dump to markdown-ish files 2022-10-18 23:50:01 -07:00
Lucas Nicodemus
7eede03c38
Start to update documentation (#2728)
* Init docsify

* Readme: fix build badge, remove contributors

The "all contributors" section is woefully out of date and for many
reasons, it's not something we're going to support. Going forward, we're
going to try to find a different / better / more inclusive way of doing
contributions in such a way that's meaningful to people.

* Fix build badge again

* Update experimental build download instructions

* Remove note about Travis CI being available

* Update install guide to use TShock.Server.exe.

* ∆: minor changes to setup instructions?

* Remove setup guide because it's out of date

* Update non-dev readme with instructions on using tshock

* Remove experimental downloads section from dev readme

* Add a link to github to non-dev docs

* Change example password

* Update non-dev readme with more data

* Move changelog to docs folder

* Rehead installing tshock

* Embed streamable video

* Create CNAME

* Update CNAME

* Update index to be a little more cool

* Rename homepage

* Rename changelog to changelog

* Document constileation and heaptile providers

* More command line docs

* Update developer readme

* Augment the readme

* Add nuget links

* Add a space

* What is the cost of lies?

* Modernize cli docs

* Document tile providers

* Clarify provider slowness

* Further doument tile providers

* ∆: modify markdown output for permissions to add wikilinks

* Remove AN
2022-10-17 23:52:24 -07:00
punchready
a03114650b chore: clean up formatting 2022-05-10 12:40:48 +02:00
punchready
7e381d61f6 fix: use more robust parsing of large timespans 2022-05-08 10:01:02 +02:00
Arthri
a1eaf285cd Merge remote-tracking branch 'parent/general-devel' into fix-invalid-place-style 2021-11-24 09:21:40 +08:00
Arthri
350d76c315 Fix bad XML(unescaped ampersand) 2021-11-23 17:13:02 +08:00
Arthri
3eaf86ba04 Explicitly add placeStyle = 0 2021-08-18 18:39:41 +08:00
stacey
e88ae85683 add colour msg for Rocket and example
we do a lil refactoring, also added a cyan pastel coloured hex code and made various other little improvements
2021-08-06 20:32:14 -04: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
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +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
39e13f74d6 Remove TShock.Itembans in favour of TShock.ItemBans 2020-11-13 19:22:10 +10:30
鱼鱼
1ed95c737e pass compile; add void vault code 2020-05-17 21:38:47 +08:00
Lucas Nicodemus
70dd72443d Update copyright to 2019 again
Fixes #1658, most likely.
2019-03-29 17:16:37 -07:00
Chris
f99b7ec359
Allow time parser to take spaces
So you can pass in `10h 5m 2s` instead of `10h+5m+2s`.
Works for things like `10h +5m -2s` as well
2018-05-22 10:10:22 +09:30
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
8d934ef08f Update to 2018 2018-01-01 02:17:21 -07:00
Lucas Nicodemus
df4da817b6 Rename Utils.ActivePlayers to something better.
Issues related to ICollections being null led to reverting migrating
this to TSPlayer until a better solution is uncovered.
2017-12-31 01:30:13 -07:00
Lucas Nicodemus
a5cad284a8 Revert "Remove Utils.ActivePlayers"
This reverts commit b613fdcda6.
2017-12-31 01:28:21 -07:00
Lucas Nicodemus
43ddb73112 Revert "Migrate calls from Players.Length to ActivePlayers"
This reverts commit 521283c36b.
2017-12-31 01:24:54 -07:00
Lucas Nicodemus
521283c36b Migrate calls from Players.Length to ActivePlayers
As pointed out by @QuiCM, TShock.Players is actually an array and not a
smarter collection, so length will return the total collection size and
not the active players. An earlier commit was added that gives TSPlayer
an ICollection<TSPlayer> that contains only active players. This is now
the basis of determining the number of active players on the server.
2017-12-31 01:13:33 -07:00
Lucas Nicodemus
4eebaf6c44 Rename methods that were ambiguous in meaning.
This renames some methods in the Utils class to better reflect what they
do or what they provide back. It should be clearer what these methods
are for now than before.
2017-12-29 08:50:48 -07:00
Lucas Nicodemus
332e6b2518 Remove Utils.GetGroup().
This method duplicates Groups.GetGroupByName().
2017-12-29 08:45:29 -07:00
Lucas Nicodemus
3ac52091ea Move SendFileToUser to TSP.SendFileTextAsMessage.
This is not a great method, but it's actually the only method in TShock
that interpolates the %map% and %players% variables and it used in at
least three places in the codebase. Since it's already so specialized,
it's not worth changing it to take an actual File object, in my humble
opinion.

This also clarifies what the method does and what makes it special, as
opposed to being fairly generic.
2017-12-29 08:40:44 -07:00
Lucas Nicodemus
17d151b8f8 Move HasBanExpired to Bans.RemoveBanIfExpired().
The ban system needs a full rewrite anyway, but this move removes
something from Utils, puts it closer to its operating point, simplifies
the method, and clarifies what it actually does.
2017-12-29 08:32:45 -07:00
Lucas Nicodemus
f06d1fd238 Remove Utils.GetPlayers().
This is a public method that only has two uses in TShock and both of
them are listing players to a player. A foreach isn't rocket science and
this method was originally created just because there was no good object
to iterate on (e.g., a TSPlayer array).
2017-12-29 08:26:51 -07:00
Lucas Nicodemus
48393d60c7 Move SendMultipleMatchError to TSPlayer.
This is a great method for a player to have and not for the Utils class
to have.
2017-12-29 08:15:04 -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
152c67f27c Move Utils.Ban -> TSPlayer.Ban.
Arguably, this is one of the more controversial methods that's being
kept. Because it kicks and bans a target player, it's more useful than
removing it and requiring people to interface with the TShock Ban
Manager directly (not a good move for the future). Whether or not this
method sucks is up for debate, but right now I think it's totally fine
to keep it around in a different location.
2017-12-29 08:00:30 -07:00
Lucas Nicodemus
a5a3aae599 Remove Utils.GetPlayerIP() 2017-12-27 19:29:45 -07:00
Lucas Nicodemus
f74a0f6a70 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:03:03 -07:00
Lucas Nicodemus
70f22c1e70 Fix Travis 2017-12-27 18:23:11 -07:00
Lucas Nicodemus
8301d6a6f3 Remove Utils.ForceKickAll; add TSPlayer.KickAll. 2017-12-27 18:07:28 -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
f79c6a2962 Move Utils.Kick to TSPlayer.Kick 2017-12-27 13:00:13 -07:00
Lucas Nicodemus
e705e398e8 Return real nulls as opposed to string nulls 2017-12-27 11:30:39 -07:00
Lucas Nicodemus
b613fdcda6 Remove Utils.ActivePlayers
Duplicated what an array already stored and told us, but added code and
was obscure. It predated TSPlayers existing.
2017-12-26 21:14:16 -07:00
Lucas Nicodemus
9648e9ac0c Remove excess space 2017-12-26 20:55:33 -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
cb47240c7e Fix indentation on one line in utils 2017-12-26 20:17:11 -07:00
Lucas Nicodemus
846386f98a Merge remote-tracking branch 'origin/general-devel' into old-code 2017-12-26 20:07:34 -07:00