Quick bug fix - forgot about respawns + only set handshake once
The connection state should NEVER be set to under 3 if the player is fully connected.
This commit is contained in:
parent
4c01740177
commit
4f2fff050d
2 changed files with 4 additions and 2 deletions
|
|
@ -2726,7 +2726,8 @@ namespace TShockAPI
|
||||||
short numberOfDeathsPVP = args.Data.ReadInt16();
|
short numberOfDeathsPVP = args.Data.ReadInt16();
|
||||||
PlayerSpawnContext context = (PlayerSpawnContext)args.Data.ReadByte();
|
PlayerSpawnContext context = (PlayerSpawnContext)args.Data.ReadByte();
|
||||||
|
|
||||||
args.Player.FinishedHandshake = args.Player.State == 3; //If the player has requested world data before sending spawn player, this should be set to 3, otherwise it'll be set to 1.
|
if (args.Player.State >= 3 && !args.Player.FinishedHandshake)
|
||||||
|
args.Player.FinishedHandshake = true; //If the player has requested world data before sending spawn player, this should be equal to or greater than 3, otherwise it'll usually be 1. Also only set this once to remove redundant updates.
|
||||||
|
|
||||||
if (OnPlayerSpawn(args.Player, args.Data, player, spawnx, spawny, respawnTimer, numberOfDeathsPVE, numberOfDeathsPVP, context))
|
if (OnPlayerSpawn(args.Player, args.Data, player, spawnx, spawny, respawnTimer, numberOfDeathsPVE, numberOfDeathsPVP, context))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -1461,6 +1461,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TShock.Log.ConsoleInfo($"Setting handshake to false for {tsplr.Name}");
|
||||||
|
|
||||||
tsplr.FinishedHandshake = false;
|
tsplr.FinishedHandshake = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue