Commit graph

479 commits

Author SHA1 Message Date
Lucas Nicodemus
56041f2c1a
Merge remote-tracking branch 'ghsa/handshake-final-update-fix' into general-devel 2025-03-10 01:08:28 +09:00
Lucas Nicodemus
13a4a0864b
Merge branch 'general-devel' into playerdata-changes 2025-03-10 00:39:33 +09:00
ohayo
1abb53b22e
Update TShockAPI/TSPlayer.cs
Oops

Co-authored-by: Chris <2648373+QuiCM@users.noreply.github.com>
2025-03-04 21:01:01 +10:00
ohayo
701a7d1ca0
Update TShockAPI/TSPlayer.cs
Co-authored-by: Chris <2648373+QuiCM@users.noreply.github.com>
2025-03-04 21:00:33 +10:00
ohayo
56c5865043 Emergency bug fix for handshake on all/server player
The All Player does not have a valid state and because FinishedHandshake is false by default, they would never get time update packets, etc.
2025-02-11 07:47:14 +10:00
Joseph Goh
836cc33c8d rewrite: bed spawning for SSC 2025-02-10 11:42:36 +08:00
ohayo
5a23073db5 Suggestions + fix last missed magic number 2025-02-05 09:33:36 +10:00
ohayo
ce04d9d173 Remove magic number + Use suggestions by particles
Added a new ClientState enum based on code in Terraria.MessageBuffer.GetData & Terraria.Netplay.InnerClientLoop
2025-02-04 21:06:40 +10:00
ohayo
fa3c144274 Add necessary packets to a static hashset for further performance boosts
title
2025-02-04 11:28:09 +10:00
ohayo
52d1840003 Packet filtering for those who never finish the handshake
This also kicks those who never finish handshaking upon chat now. (To free up the resources a bit I guess?)

Before a player finishes the connection handshake, the server will check if it's necessary to send them a packet - it checks against a list of necessary packets like:

- ContinueConnecting (Send User Slot),
- PlayerSpawnSelf (CompleteConnectionAndSpawn),
- WorldInfo (Which the server does a further check if the player is at the appropriate state to be sent the world info)
- Status
- Disconnection
- TileFrameSection & TileSendSection
2025-02-04 11:07:10 +10:00
ohayo
53789b40e4 Prevent further things from clients who dont handshake
- The player will only finish the handshake once they spawn their player, a normal client would always do this eventually.

- They cannot chat, even if they request world data but just not spawn their player.

- Other clients will not be notified of their join/leave in both cases (dont request WD or do but dont spawn)

- And most importantly, they do not show on the in game player list but still show on the server console /playing cmd.
2025-01-31 09:17:26 +10:00
Zoom L1
f5df85e90e
Merge branch 'general-devel' into playerdata-changes 2023-06-17 19:02:48 +07:00
AkjaHAsLk1IALk0MasH
b184133a7f Updated the call to the obsolete constructor PlayerData 2023-05-14 10:43:01 +07:00
AkjaHAsLk1IALk0MasH
4d92f11cc8 Added the TSPlayer.Hostile property.
It gets `TPlayer.hostile`.
I also wanted to add the ability to change `TPlayer.hostile`, but noticed a property `TSPlayer.Team`. You can only use the `TSPlayer.SetTeam` method to change it. So it's exactly the same here: You can use the method `TSPlayer.SetPvP` (By the way, it should be renamed to `TSPlayer.SetHostile`)
2023-05-14 09:56:47 +07:00
AkjaHAsLk1IALk0MasH
2f7514c0ef Added an overload for TSPlayer.GiveItem
Added `TShockAPI.NetItem` structure to the parameters.
2023-05-14 09:43:18 +07:00
AkjaHAsLk1IALk0MasH
3d585d4d69 Added the UpdateSection method.
I described its action in the comments.
2023-05-14 09:38:35 +07:00
AkjaHAsLk1IALk0MasH
d9352d6902 Added an exception that occurs when the developer changes team. 2023-05-14 09:23:42 +07:00
AkjaHAsLk1IALk0MasH
3647bbaf54 Added a reason for the KillPlayer and DamagePlayer methods.
Added overloads that have a cause in the parameters (`PlayerDeathReason`)
2023-05-14 09:20:20 +07:00
AkjaHAsLk1IALk0MasH
fa9e4419bd Added documentation to the withMsg parameter in the SetPvP method. 2023-05-14 09:16:14 +07:00
AkjaHAsLk1IALk0MasH
c047b0e87d Added the Client property.
The `Client` property gets data from the array `Terraria.Netplay.Clients`.
2023-05-14 09:14:43 +07:00
AkjaHAsLk1IALk0MasH
6d4682ed7e Updated the GodMode field.
* Changed the GodMode field to a property that is controlled by the journey mode.
- Removed the call to godmode in `Commands.ToggleGodMode`.
2023-05-14 09:11:18 +07:00
ATFGK
95d157fd5d
Fix Terra Blade triggered MaxProjDamage, other net changes (#2852)
* update

* update

* update

* Update changelog.md

* Update changelog.md

Fixed syntax errors.

* Update SpawnMsg.cs

Use insteadUpperCamelCase

* Update changelog.md

* Update TSPlayer.cs

* Update TSPlayer.cs

Missing letters due to input method problems.

* Update `docs/changelog.md`

Co-authored-by: James Puleo <james@jame.xyz>
2022-12-05 21:45:37 -08:00
SGKoishi
770b177426
Rewording update 2022-11-04 20:40:07 -07:00
punchready
4f22d6a11e
Fix item giving
Previously this would potentially drop too many items on the ground if the inventory doesn't have enough free slots.
2022-11-01 01:29:46 +01:00
Lucas Nicodemus
61e36d0abd
Move GiveItemsDirectly config item to tshock config
Due to an issue that stops the SSC config persister thing from working,
I moved the config item that's new back to the config file. I tried
applying the patches from
https://github.com/Pryaxis/TShock/pull/2354/commits but these didn't
actually resolve the issue. I'm keeping the commits here but I'm not
sure they help.

The core problem is this: if you add a new config file item to the ssc
config, the ssc config is overwritten with the default config items
instead of being merged automatically with the new items. This is a
critical issue as it means that SSC is disabled on all servers that had
it enabled and results in "data misplacement" which is alarming enough
to cause users to think they had data loss, which is not ideal.

Until the issue with the SSC config is resolved, I'm not willing or
confident to change it.
2022-10-31 16:18:39 -07:00
Janet Blackquill
7198a47e82 Add ability for items given to players to be inserted directly into their inventory instead of spawned as an item drop 2022-10-28 15:04:53 -04:00
SGKoishi
f8c0f0ce15
i18n most texts 2022-10-24 21:16:28 -07:00
Lucas Nicodemus
1523b0d67c
Internationalizify more commands
This is most of commands through to projectile bans.
2022-10-22 18:23:40 -07:00
James Puleo
9dbe8c9e40
Check loadout slots for hacked item stacks 2022-10-22 17:37:00 -04:00
Luke
d6caeb15cc Fix hard/mediumcore ban on death
Removed the force parameter since it is of no use.
2022-10-07 18:42:31 +10:00
Luke
aa0bd7deb2 Merge branch 'general-devel' into otapi3 2022-09-06 22:23:34 +10:00
Anzhelika
b19a928fd8 PlayerHasBuildPermission hook (#8) 2022-07-24 19:23:10 -04:00
Lucas Nicodemus
49a2dce59e Merge remote-tracking branch 'origin/general-devel' into otapi3 2022-04-01 01:14:01 -07:00
gohjoseph
516add7803 Fix GiveItem not working if the player is in lava 2022-03-21 01:17:30 +08:00
Lucas Nicodemus
acde508c53 Merge branch 'general-devel' into otapi3 2022-02-28 00:15:06 -08:00
Patrikkk
1b96ed8992 Adding EntitySource parameter to the used at NewNPC and NewItem methods.
I've decided to use the DebugCommand entity source for anything server related, as it makes the most sense as source. Feel free to discuss.
2022-02-25 04:42:16 +01:00
Lucas Nicodemus
78169c87cb Merge remote-tracking branch 'origin/general-devel' into otapi3 2022-02-16 18:44:33 -08:00
0x3fcf1bbd
c6b04053a3
Removed clamping as the game does it itself. 2022-02-16 12:12:50 +01:00
0x3fcf1bbd
9bc936053b
Fixed STR width & length clamping being incorrect.
The main game should however clamp it itself too before sending, so there shouldn't be issues.
2022-02-16 11:32:43 +01:00
0x3fcf1bbd
874b3b2746 Reverted STS change, added STSC, fixed STS/STSC usage. 2022-02-01 16:00:05 +01:00
0x3fcf1bbd
af99c4cb8d
Fixed STS not being centered.
Inferring from the usage of it, this method was expected by its callers to be a square centered around the given coordinates (x, y), hence this being a fix.
2022-01-26 14:17:27 +01:00
Lucas Nicodemus
dfaad68106 Merge branch 'general-devel' into otapi3 2021-12-08 22:55:11 -08:00
James Puleo
fe3a59f84a
Fixed rejection check inside of HandlePaintTile to account for the
Paint Sprayer (or Architect Gizmo Pack) being inside your inventory,
rather than on an accessory slot.
2021-12-07 02:42:27 -05:00
Luke
cec53c780f Merge branch 'general-devel' into otapi3 2021-11-27 17:53:28 +10:00
Zoom L1
f98df0e4a3
Merge pull request #2447 from AgaSpace/patch-1
Add the ability to change the player's pvp mode
2021-11-23 22:52:47 -08:00
Luke
8edd0393e5 Initial OTAPI3 port
TODO: sqlite
2021-11-23 20:49:41 +10:00
stacey
2b50cbc7b9
Merge branch 'general-devel' into general-devel 2021-09-13 09:52:46 -04:00
Armano den Boef
ccea7b7d57
Return loopback IP if RealPlayer is false 2021-08-09 01:32:17 +02:00
stacey
7e4f05eb9c add colours to annoy
and add silent support
2021-08-06 16:29:20 -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