Forums Index >> Modding >> Packet Loss Script?



Page : <1> :


Is it possible to have a script like the high ping script but one that measures packets loss for individual players on the server side? Is just possible to monitor/check packets loss in TT? Any info would be great.

 

Friday, June 02, 2006 at 11:18:14 AM

Saturday, June 03, 2006 at 7:56:10 AM

He knows you have a ping script but Ping doesnt always mean Lag, Packet loss is whether or not you lag.

@NUTS: I think Thinktanks supports packetloss is scripts but Im not certain, The master scripter is Art Crazyİ

 

 

 

 

Saturday, June 03, 2006 at 11:42:47 AM

Simple and in a nutshell...
Just put this anywhere that gets executed...

 

                                        
function checkpacketloss()
{
%len = clientgroup.getCount();
for(%i=0;%i<%len;%i++)
{
%u = clientgroup.getObject(%i);
if(%u.getpacketloss() >= 200)
{
schedule(500,false,"MessageAll","",%u.namebase@" has been kicked for bad lag!", 4,3);
%u.delete("Sorry, you have lag...");
}
}
schedual(30000, false, "checkpacketloss");
}
checkpacketloss();

 

 

The master scripter is Art Crazyİ

 

Yeah thanks... :P

 

 

 

 

Saturday, June 03, 2006 at 3:22:34 PM

^ I should explain....
Every 30 seconds this will test all players for bad packet loss...
If you still experiance lag from someone

 

                                        
if(%u.getpacketloss() >= 200 )

 


change that 200 to a lower number...
If you have no lag but people are being kicked... Change the 200 to a higher number...
I just picked 200 out of thin air.

 

 

 

 

Saturday, June 03, 2006 at 3:24:57 PM

Woot!

Thanks guys, I will try give it a run later tonight.

 

Schedual(30000, false, "checkpacketloss");

 

I take it if I want the checks to happen every minute instead of every 30 seconds I change this number?

 

 

Saturday, June 03, 2006 at 3:55:24 PM

Yes... 1000 means one second so 60000 means one minute

 

 

 

 

Saturday, June 03, 2006 at 4:12:51 PM

Ok had it running last night. Actually threw it into my dash folder:

*** Mission loaded
Engine initialized...
Loading compiled script game/server/dash/main.cs.
Loading compiled script game/server/dash/prefs.cs.
Loading compiled script game/server/dash/ConsoleUtilities.cs.
Loading compiled script game/server/dash/GameConnection.cs.
Loading compiled script game/server/dash/Codes.cs.
Loading compiled script game/server/dash/UberBots.cs.
Compiling game/server/dash/pcktloss.cs...
Loading compiled script game/server/dash/pcktloss.cs.
Sending heartbeat to master server [IP:216.116.32.49:28002]

I had it set at 3. Got up to a full server and no one booted. There was even a time were I wasn't seeing my bullets so I should have been booted? Not sure it this check just looks at the specific moment to see if there was a packet loss, or if its even enabled in TT. Is it possible to have the check run for a duration of, say 5 seconds? I currently have it running in my server set to 1, to see if anything happens.

 

Last edited: Sunday, June 04, 2006 at 5:35:32 AM

Sunday, June 04, 2006 at 5:34:46 AM

I have:

 

If(%u.getpacketloss() >= 1)

 

And

 

Schedule(30000, false, "checkpacketloss");

 

Is still the same.

I had it set the packet loss set at 200 and Rob Zombie came in and it never booted him. So I knew it was set way to high.I changed the 200 to 3 last night and is still booted no one now its set to 1.

Does the packet checker just check for packet loss at the one moment or does it keep a running tally?

 

 

Last edited: Sunday, June 04, 2006 at 7:11:40 AM

Sunday, June 04, 2006 at 7:08:26 AM

What about a:

 

PacketDropped()

 

Check?

Is that feasable or am I barking up the wrong tree?

 

 

Last edited: Sunday, June 04, 2006 at 9:18:33 AM

Sunday, June 04, 2006 at 9:17:40 AM

I had no idea that there was a function getPacketLoss()! SO, it is an integer? How much packet loss a person is experiancing? Okay, I will keep that in mind.

I don't know if you guys want, but I could install this into my ping script, but make some changes... That way it could be a little more percise....

Just tell me if this would be something you guys would like...

Sunday, June 04, 2006 at 9:37:10 AM

 

 

                                        
function checkpacketloss()
{
%len = clientgroup.getCount();
for(%i=0;%i<%len;%i++)
{
%u = clientgroup.getObject(%i);
if(%u.getpacketloss() >= $maxLag)
CheckLoop(%u);
}
schedule(30000, false, "checkpacketloss");
}
checkpacketloss();
function CheckLoop(%client,%loopNum)
{
%loopNum++;
%ranInt = getRandom(7) - $maxLag;
if (%client.getPacketLoss() <= %ranInt)
return;
if (%loopNum < 25)
{
%client.delete("You had bad lag.");
BottomPrintAll(%client.nameBase SPC "was kicked for lag.",2,1);
return;
}
schedule(400,"CheckLoop",%client,%loopNum);
}
$maxLag = 200; // maximum lag amount

 

So basicaly what I did was make it so someone wasn't just kicked automaticaly, but they had to maintain their high lag for about 14 seconds. But, the lag number is exact... You'd be within about 7 integers of 200... That way, someone couldn't just get away with a packet loss of 199... You understand?

I could do some more cool stuff, just would install this into my ping script, and make it better..

Warfare, youre just to smart.... ;)

Last edited: Sunday, June 04, 2006 at 10:22:39 AM

Sunday, June 04, 2006 at 10:04:38 AM

Sweet!

Can't wait to try.

Thank you!

 

Sunday, June 04, 2006 at 10:22:17 AM

Wait, I just edited it

I forget to change warfares mistake, the first schedual should be schedule

Sunday, June 04, 2006 at 10:23:24 AM

The number 200 was random... I do not know how the function calculates packet loss or what values it gives you
I only know that the number 0 is the packet loss for someone who is not losing any packets, like say, a hoster in their own server

Experiment with this :P

 

 

 

 

Sunday, June 04, 2006 at 10:55:30 AM

^ actually you just need to set up a dedicated server, and when people join.... Use the getpacketloss function on them in the console to see what good numbers are

 

 

 

 

Sunday, June 04, 2006 at 11:48:24 AM

Yes I think that 200 number may be a little high. Thats normaly the setting for max packets allowed by the server.

$pref::Net::PacketRateToServer = 32 (per second)
$pref::Net::PacketRateToClient = 10 (per second)
$pref::Net::PacketSize = 200 (bytes)

I am on dsl so I use:

$Pref::Net::PacketRateToClient = 24;
$Pref::Net::PacketRateToServer = 24;
$Pref::Net::PacketSize = 350;

So if someone with a perfect connection would be about 168bytes (24*the approximate 7 seconds). So I think I would start with a number at least under that.

 

Sunday, June 04, 2006 at 12:27:39 PM

Is it possible to to take the information from the getPacketLoss function and have it thrown into a file. That way I could just leave it running and then just average and see.

 

Sunday, June 04, 2006 at 2:06:31 PM

Openoffice ;)

Yes, don't need the names or anything else like that. Just the numbers.

 

Sunday, June 04, 2006 at 2:31:05 PM

Well, it's return value might not be viewable to the open eye.... You should try a trace...

Tuesday, June 06, 2006 at 4:54:04 PM

Cool, will see what I can dig up

 

Tuesday, June 06, 2006 at 6:56:17 PM

Okay, I've got a solution: Type "echo([CADD].getPacketLoss());". Echo returns that value so you can see it. I tested a guy with a ping of around 90 and got 0 packet loss. A decent threshold should be about 10. Yeah, that low. Try it yourself.

Sunday, June 11, 2006 at 6:53:24 AM

Hmm does that check run the packetloss check that CS wrote (with the loop) or does that just do the regular one second packet check? I believe I have mine currently set on 5. Still trying to look into how to check and see what numbers its getting, just have been busy going through the TGE tutorials.

 

Sunday, June 11, 2006 at 12:27:50 PM

You know PacketLoss is something really different from what we usually call as "lag", it is one cause, but rarely happens!


Sunday, June 11, 2006 at 2:24:57 PM

True packetloss is something else, not really latency. However, if you have enought players with packetloss it throws the server out of whack.

 

Sunday, June 11, 2006 at 3:14:08 PM

Ok turned the trace on:
% trace(1);
Console trace is on.
Entering (null)::checkpacketloss()
Leaving (null)::checkpacketloss - return 0
Received info request from a master server [IP:216.116.32.49:28002].
Entering (null)::checkpacketloss()
Leaving (null)::checkpacketloss - return 0

After I jump in the server:

Entering (null)::checkpacketloss()
Leaving (null)::checkpacketloss - return 1255

Different map:
Entering (null)::checkpacketloss()
Entering (null)::CheckLoop(1171)
Leaving (null)::CheckLoop - return 1171
Leaving (null)::checkpacketloss - return 1171

After a few people join:
Entering (null)::checkpacketloss()
Entering (null)::CheckLoop(6157)
Leaving (null)::CheckLoop - return 6157
Entering (null)::CheckLoop(6999)
Leaving (null)::CheckLoop - return 6999
Leaving (null)::checkpacketloss - return 6999

Entering (null)::checkpacketloss()
Entering (null)::CheckLoop(1171)
Leaving (null)::CheckLoop - return 1171
Entering (null)::CheckLoop(2292)
Leaving (null)::CheckLoop - return 2292
Entering (null)::CheckLoop(5990)
Leaving (null)::CheckLoop - return 5990
Entering (null)::CheckLoop(6157)
Leaving (null)::CheckLoop - return 6157
Leaving (null)::checkpacketloss - return 6157

I have taken the max lag number down to zero. Shouldn't that kick me out? Guess I need to get/find a little more clarification as to what this packeloss is really checking and adjust the number accordingly. Any ideas?

 

 

Last edited: Monday, June 12, 2006 at 10:09:30 PM

Monday, June 12, 2006 at 10:05:29 PM

Yeah, Sorry nuts but I don't know anything about the get packet loss function. It could be a thousand things...

The closest we can get to covering connections is ping (to my knowledge).

Anyways. Goodluck

Tuesday, June 13, 2006 at 7:08:28 PM

What about a FPS script?

Pray to GOD for him to reveal himself to you.

Tuesday, June 13, 2006 at 7:13:32 PM

Don't really need a script for that. Just type ---> metrics(fps); in a console. That will let you know how many frames per second that individual computer is doing. Not sure if you could do it server side.

 

Wednesday, June 14, 2006 at 5:57:51 AM

^^ Download the wingman script if you want to see your framerate.

Wednesday, June 14, 2006 at 11:05:47 AM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald