Skip to content

Problem with TSPlayer.All #2106

Answered by Quinci135
Razrimo asked this question in Q&A
Jul 29, 2020 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

TSPlayer.All is a static readonly instance only for the sake of public broadcasts like TSPlayer.All.SendInfoMessage("This is a public message.");. Other methods do not work normally with this tsplayer object. TSPlayer constructer has the player index by default -1, and sendmessage will broadcast a message publicly if the player index is -1.
https://github.com/Pryaxis/TShock/blob/general-devel/TShockAPI/TSPlayer.cs#L1430
The TShock.All.Kick in Utils.cs doesn't work either (not that it matters, you get disconnected and notified of the server shutdown anyways. Probably due to an api change of kick being moved from utils to tsplayer and mistakenly replacing utils.kickall with tsplayer.all.kick)

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@Quinci135
Comment options

@Razrimo
Comment options

Answer selected by Razrimo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@Razrimo
Comment options

@Quinci135
Comment options

@Razrimo
Comment options

@Razrimo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants