Commit graph

1015 commits

Author SHA1 Message Date
Lucas Nicodemus
67a1a669a4
Update version codename 2021-04-10 20:31:33 -07:00
Chris
b4789607f6 Implement suggestion for fixing forceupdate flag 2021-03-23 11:44:24 +10:30
Lucas Nicodemus
355a7f02f5 Fix ∞ velocity exploit (@bartico6, @tlworks) 2021-01-28 00:39:09 -08:00
Chris
9423febd0a Refactor for new configuration 2020-12-03 17:43:10 +10:30
Chris
24a4ab885c Offload ban checking to BanManager
Remove ban immunity
2020-11-29 18:10:47 +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
39e13f74d6 Remove TShock.Itembans in favour of TShock.ItemBans 2020-11-13 19:22:10 +10:30
Chris
badba523e7
Merge branch 'general-devel' into projectilestruct-addition 2020-06-01 19:12:38 +09:30
Olink
96c7453b33 Merge branch 'general-devel' of github.com:Pryaxis/TShock into fix-bugs 2020-05-30 11:54:09 -04:00
Patrikkk
9934a3935d ProjectileStruct - Adding extra data
Can we store the type of the recent projectile as well? This could be used in my upcoming PR regarding the golf packet where I check for recently created projectiles, and their types. Having only the index is not useful in this scenario, because the projectile can already be killed, so cannot access the Main.projectile array to get the projectile type.

Can this be public instead of internal? Developers could make good use of it, instead of having to implement their own version of RecentProjectiles in their plugins.
2020-05-30 11:22:50 +02:00
Lucas Nicodemus
01e3f9c58d
Merge branch 'general-devel' into general-devel 2020-05-30 00:32:57 -07:00
Lucas Nicodemus
44ad2d2eff
Remove extra debug info from OnGetData
Per packet debug logs are redundant for people with the packet monitor
plugin. If you need packet monitoring, please install the packet monitor
plugin.
2020-05-29 19:52:03 -07:00
Olink
fd6913f7df Update GetDataHandlers ExtraValue packet handling to match the network protocol.
Update the validation logic to be accurate:
  * use pixels and not tiles
  * allow master mode
  * use npc position and not player position
Cleanup some style inconsistencies in NetHooks_SendData.
2020-05-29 16:44:03 -04:00
Olink
079541d4c9 Initial working commit. 2020-05-27 23:05:45 -04:00
Lucas Nicodemus
3874c04a72
Replace -worldpath with -worldselectpath
This reverts commit 7ad46abced. This
reintroduces the worldpath argument as per request from #1914, but at a
different name. This is because users have configurations like this,
which no longer work:

-world + -worldpath = crash

If you want to use -worldselectionpath to specify a world, you should be
able to use -worldname, but don't use -world unless you specify an
absolute path to a world.

No matter how we solve this we get a support headache (-worldpath +
-world = crash). This temporary stopgap should work to help address
issue #1914 until we can figure out a final solution. Since users are
impacted by this change, temporarily adding this back is the best move.

To be 100% clear, though:

-world + -worldselectpath without specifying an absolute path will
result in a crash that is unhelpful. Please don't do that.
2020-05-25 11:57:45 -07:00
Olink
56b695b80b Add initial support for Journey mode in SSC. 2020-05-25 02:24:03 -04:00
Lucas Nicodemus
1eeb77d61f
Update codename 2020-05-24 17:32:12 -07:00
Olink
16d1cdd360 Track projectile updates being sent by the server, instead of received by the server. 2020-05-24 16:00:20 -04:00
Olink
b73088306d Move the projectile refresh to Bouncer.
Bouncer now has an OnSecondUpdate().
Move projectile created tracking to GetDataHandler from Bouncer.
2020-05-24 04:27:12 -04:00
Olink
965361c406 Add a projectile tracker, so that we can allow fluid bombs. 2020-05-24 03:48:08 -04:00
Lucas Nicodemus
f25ed62599
Make setup system less confusing to new players 2020-05-20 15:36:27 -07:00
Axeel
773092b7bf
Merge branch 'general-devel' into sqliteconf 2020-05-20 22:46:15 +08:00
鱼鱼
946d54b69e fix player spawn stuff 2020-05-20 21:27:49 +08:00
鱼鱼
1eaa1eb901 Make sqlite db path configurable 2020-05-20 19:44:48 +08:00
Chris
7ad46abced Removed -worldpath because you should now just use -world with the full file path 2020-05-20 18:00:28 +09:30
Lucas Nicodemus
e9098d0e78
Add verbose debug logs to a variety of checks
These are high priority checks we really want to look at. I want to add
more of these debug statements to all checks in Bouncer and other parts
of GetDataHandlers, but I think this is good enough for now.
2020-05-19 22:11:21 -07:00
Lucas Nicodemus
013c58e923
Update TShock version codename 2020-05-18 01:00:23 -07:00
鱼鱼
1ed95c737e pass compile; add void vault code 2020-05-17 21:38:47 +08:00
Lucas Nicodemus
b5f95d5918
Fragments: Separate out item bans (#1595)
* Remove commented out warning disable

* Add initial ItemBans segregation infrastructure

* Add shell for initial OnSecondUpdate stuff

* Add comments yo

* Remove duplicated logic

* Split out more item ban code

This part of the fragments work is primarily aimed at reducing the
complexity of OnSecondUpdate in TShock and moving that check out into
the ItemBans subsytem.

Of major note in this is the removal of "check", which was a string
variable that tracked state and replacement of many of the item ban
activities with sane private methods that are at least somewhat
sensible. Obviously there's a lot to be desired in this system and I'm
really going for a run here by trying to continue a branch from so long
ago that I barely even remember the whole point of existence.

Still to do: GetDataHandlers related item ban code needs to be moved
into its own hook in the ItemBan system. Finally, there is a downside to
some of this: we're basically iterating over players again and again if
we keep this pattern up, which is kinda lame for complexity purposes.

* alt j: comment changes

* Move item ban check out of main playerupdate check

Separates out item ban logic from the rest of GetDataHandlers so that
item bans is more isolated in terms of what fragments is asking for.

* alt-j: convert indentation to tabs

* alt-j: fix botching source code

* Move item ban related chest checks out of gdh

* Remove chest item change detection from item bans

It doesn't do anything. If a user removes an item from a chest, it
bypasses this check. If a user adds an item to a chest, the server seems
to persist the change anyway, even if the event is handled. That's a bug
for sure, but fundamentally, it's not the item ban system's fault.

* Revert "Remove chest item change detection from item bans"

This reverts commit 758541ac5c4d4096df2db05ba2a398968113e1e4.

* Fix logic issues related to item ban handling

Re-implements chest item handling and correctly handles events and
returns after setting handled event state.

* Remove TSPlayer.HasProjectilePermission

In infinite wisdom, it turns out this is not a good method for TSPlayer
to have. It just checks the states of things as per what the item ban
system says is banned and then creates implicit relationships to the
projectile ban system.

Doing this effectively knocks down another external reference to the
item ban system outside of the context of the implementation for the
system itself and its related hooks.

This commit also adds context around what the heck is going on with some
of our more interesting checks as per discussions in Telegram with @Ijwu
and @QuiCM.

* Update changelog

* Remove useless ref to Projectile.SetDefaults

* Change item ban to ban based on ID not strings

I think I was so confused as to why we were passing strings everywhere
that I just felt inclined to continue the trend in previous commits.
2020-05-16 16:27:34 -07:00
Chris
76eeab1090
Merge branch 'general-devel' into fix-1653 2019-03-30 13:46:12 +10:30
Lucas Nicodemus
79f142f908 Change current TShock codename to "Zombie"
This change incorporates feedback from #1661 which indicates
that we should update the source code when changing copyright
dates.
2019-03-29 17:27:34 -07:00
Lucas Nicodemus
70dd72443d Update copyright to 2019 again
Fixes #1658, most likely.
2019-03-29 17:16:37 -07:00
Chris
9975c445f8
Proposed fix for #1653 - Testing required
From #1653:
>From latest version (2301)
If a player puts on a banned peice of armour, they get the message to say "You are wearing banned equipment"
After they take it off, the messages stop, but they keep getting disabled.
Solution:
Approx line 1131 in tShock.cs on `OnSecondUpdate` the `tsplayer.IsDisabledForBannedWearable` gets set to true, but it never gets set to false.
Change:
```csharp
if (check != "none")
player.IsDisabledForBannedWearable = true;
```
>To:
```csharp
if (check != "none")
player.IsDisabledForBannedWearable = true;
else
player.IsDisabledForBannedWearable = false;
```

Requires testing
2018-12-24 13:54:39 +10:30
Ivan
9ee692d93f Implement IDisposable on RegionHandler 2018-05-06 14:45:31 +02:00
Ivan
4d241381be Replace RegionHandler.OnGameUpdate with RegionHandler.OnPlayerUpdate 2018-05-06 12:18:06 +02:00
Ivan
44dfc570ab Merge remote-tracking branch 'upstream/general-devel' into regions 2018-04-29 18:39:12 +02:00
Ivan
ec78a070a7 Move Region related code into a separate subsystem 2018-04-29 18:33:07 +02:00
Lucas Nicodemus
3f58274ef4 Remove the stat tracker
The stat tracker has been offline for the last several weeks/months and
nobody has done anything to fix that. Because of that, GDPR, and the
fact that we haven't used it, we're discarding it.
2018-04-19 18:22:52 -06:00
Lucas Nicodemus
4605e24c59
Revert "Remove IP reset code in TShock init" 2018-02-18 09:14:49 -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
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
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
f74a0f6a70 Merge remote-tracking branch 'origin/general-devel' into oop 2017-12-27 19:03:03 -07:00