Author Topic: Simulating a user timeout  (Read 2387 times)

When a user loses connection with the server and it just freezes, is there a way I could create this lag artificially (via some sort of function)?

i doubt you could on a TS level

Client sided you can create a command in the console to make yourself lag for a bit (your blockland doesn't respond though)

for(%i=0;%i<5000000;%i++){}

Client sided you can create a command in the console to make yourself lag for a bit (your blockland doesn't respond though)

for(%i=0;%i<5000000;%i++){}

Nah thats not what i am trying to do. I figured it out using functions from serverConnections.cs
« Last Edit: February 16, 2015, 10:42:53 PM by St. Francis Xavier »

Maybe you could tell us how you figured it out incase other people need to know this aswell?

Maybe you could tell us how you figured it out incase other people need to know this aswell?

I'm setting the LagIcon to true, then just doing a manual client cleanup before terminating the connection with the client.

so like this

Code: [Select]
LagIcon.setVisible(%state = "true");
HudMessageVector.clear();
alxStopAll();
if (isObject(MusicPlayer))
{
    MusicPlayer.stop();
}
PlayerListGui.clear();
clientCmdclearbottomPrint();
clientCmdclearcenterPrint();
clearTextureHolds();
purgeResources();
ServerConnection.delete();

Code: [Select]
LagIcon.setVisible(%state = "true");
HudMessageVector.clear();
alxStopAll();
if (isObject(MusicPlayer))
{
    MusicPlayer.stop();
}
PlayerListGui.clear();
clientCmdclearbottomPrint();
clientCmdclearcenterPrint();
clearTextureHolds();
purgeResources();
ServerConnection.delete();

This should pretty much just do the same as disconnect(); but in a needlessly complicated way. The user will never see the LagIcon because this is blocking. The rest just looks like it's straight out of disconnectedCleanup.

LagIcon.setVisible(%state = "true");
Why?
This technically works because %a = %b; returns %b, but all you need is LagIcon.setVisible(true);

Also, why do you want this? If you want to disconnect them, then just disconnect them. Don't make them think something else is the cause

This should pretty much just do the same as disconnect(); but in a needlessly complicated way. The user will never see the LagIcon because this is blocking. The rest just looks like it's straight out of disconnectedCleanup.
It is right out of the disconnect function from serverConnection.cs

Why?
This technically works because %a = %b; returns %b, but all you need is LagIcon.setVisible(true);

Also, why do you want this? If you want to disconnect them, then just disconnect them. Don't make them think something else is the cause
Yeah it works  the same with just (true); I just got it right out of the setLagIcon function.

Replace the whole code with disconnect();

Replace the whole code with disconnect();
Don't need to.
Im going to delete the player itself to lock it still, put a delay on the kick for about 15000ms while enabling the LagIcon, adding the user to the banlist, then terminating the clients connection (not through disconnect) but through %this.Serverconnection.delete();

Don't need to.
Im going to delete the player itself to lock it still, put a delay on the kick for about 15000ms while enabling the LagIcon, adding the user to the banlist, then terminating the clients connection (not through disconnect) but through %this.Serverconnection.delete();
Why do you want to torture people?

Why do you want to torture people?

Not torturing, im making a mod that kicks players without them knowing whether it was an actual kick or if the server just went down.

Not torturing, im making a mod that kicks players without them knowing whether it was an actual kick or if the server just went down.

I can see why people would want to download a client-sided add-on in order to let servers do that to them…

The only way to do this is to have the server stop sending packets to the client, but yet have the client not receive any disconnect packet. As far as I know, there's no way to do that within torquescript.