No more client crashing on TP. Removed sending large tile square. Server Lag on Tp gone.
This commit is contained in:
parent
75f3d3c046
commit
b1a64267bb
1 changed files with 2 additions and 30 deletions
|
|
@ -191,41 +191,13 @@ namespace TShockAPI
|
||||||
//150 Should avoid all client crash errors
|
//150 Should avoid all client crash errors
|
||||||
//The error occurs when a tile trys to update which the client hasnt load yet, Clients only update tiles withen 150 blocks
|
//The error occurs when a tile trys to update which the client hasnt load yet, Clients only update tiles withen 150 blocks
|
||||||
//Try 300 if it does not work (Higher number - Longer load times - Less chance of error)
|
//Try 300 if it does not work (Higher number - Longer load times - Less chance of error)
|
||||||
if (!SendTileSquare(tilex, tiley, 150))
|
if (!SendTileSquare(tilex, tiley))
|
||||||
{
|
{
|
||||||
SendMessage("Warning, teleport failed due to being too close to the edge of the map.", Color.Red);
|
SendMessage("Warning, teleport failed due to being too close to the edge of the map.", Color.Red);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TPlayer.SpawnX > 0 && TPlayer.SpawnY > 0)
|
|
||||||
{
|
|
||||||
int spX = TPlayer.SpawnX;
|
|
||||||
int spY = TPlayer.SpawnY;
|
|
||||||
Main.tile[spX, spY].active = false;
|
|
||||||
SendTileSquare(spX, spY);
|
|
||||||
Spawn();
|
Spawn();
|
||||||
Main.tile[spX, spY].active = true;
|
|
||||||
SendTileSquare(spX, spY);
|
|
||||||
oldSpawn = new Vector2(spX, spY);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Checks if Player has spawn point set (Server may think player does not have spawn)
|
|
||||||
if (oldSpawn != Vector2.Zero)
|
|
||||||
{
|
|
||||||
Main.tile[(int)oldSpawn.X, (int)oldSpawn.Y].active = false;
|
|
||||||
SendTileSquare((int)oldSpawn.X, (int)oldSpawn.Y);
|
|
||||||
Spawn();
|
|
||||||
Main.tile[(int)oldSpawn.X, (int)oldSpawn.Y].active = true;
|
|
||||||
SendTileSquare((int)oldSpawn.X, (int)oldSpawn.Y);
|
|
||||||
NetMessage.syncPlayers();
|
|
||||||
}
|
|
||||||
//Player has no spawn point set
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Spawn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SendTeleport(Main.spawnTileX, Main.spawnTileY);
|
SendTeleport(Main.spawnTileX, Main.spawnTileY);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue