Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×

Round Trip Time (RTT) Ping Statistics


Recommended Posts

  • Nitro Booster

M2 Download Center

This is the hidden content, please
  ( GitHub )
This is the hidden content, please
 
( MEGA )
This is the hidden content, please
 
( Internal )

Hey M2Dev, here is a little statistics overview of the Round Trip Time (RTT) Ping and Packet Loss.

Usefully for some, useless for others, so I decided to share it.

Preview

240109Preview.png

The image is an example...
The results where not captured accurately because they kept updating while I tried to take screenshots.
You will not get any PING on localhost.

 

If you find any problems let me know.

Edited by Owsap
Links & Repository Updated.
Link to comment
Share on other sites

There is a nice memory leak, that spammed in every 5 seconds and makes high memory usage few hours later... 

Please, be carefull when you use memory allocations... 

Easy to fix it, lets correct it. 

Link to comment
Share on other sites

1 hour ago, UdvAtt108 said:

There is a nice memory leak, that spammed in every 5 seconds and makes high memory usage few hours later... 

Please, be carefull when you use memory allocations... 

Easy to fix it, lets correct it. 

please share fix

Link to comment
Share on other sites

41 minutes ago, luqurote said:

please share fix

In ServerStateChecker.cpp file, end of CServerStateChecker::GetEchoReply function:

 Replace the following:

return;

with it:

free(ReplyBuffer);

 

Edit:

Or you can use fixed static variable as buffer, that is should be better in this case. 

Edited by UdvAtt108
Link to comment
Share on other sites

I have this sysser:

0724 13:48:16827 :: UISCRIPT_LOAD_ERROR: can only concatenate tuple (not "list") to tuple [filename UIScript/MiniMap.py]
0724 13:48:16829 :: 
uiMiniMap.py(line:341) __LoadWindow
ui.py(line:3740) GetChild

MiniMap.LoadWindow.Bind - <type 'exceptions.KeyError'>:'RTTTextLine'

 

Link to comment
Share on other sites

  • Nitro Booster
12 hours ago, UdvAtt108 said:

There is a nice memory leak, that spammed in every 5 seconds and makes high memory usage few hours later... 

Please, be carefull when you use memory allocations... 

Easy to fix it, lets correct it. 

Glad someone had to point that out, obviously, every allocation must be freed after using it but I wasn’t sure if IcmpSendEcho2 function cleared it for me, but honestly, I forgot about it.
Since you had good eyes in pointing that out, you also forgot to mention to close the IcmpFile HANDLE.

7 hours ago, Jimmermania said:

I have this sysser:

0724 13:48:16827 :: UISCRIPT_LOAD_ERROR: can only concatenate tuple (not "list") to tuple [filename UIScript/MiniMap.py]
0724 13:48:16829 :: 
uiMiniMap.py(line:341) __LoadWindow
ui.py(line:3740) GetChild

MiniMap.LoadWindow.Bind - <type 'exceptions.KeyError'>:'RTTTextLine'

 

The file in the tutorial "UIScript/MiniMap.py" already contains the correct structure to attach more children in the window. If you didn't use the file you can do this (2 options);

Spoiler
''' 1. @ UIScript/MiniMap.py '''
# Search all
	"children" :
	(
		...
	),

# Replace with
	"children" :
	[
		...
	],

 

Or you can just add;

Spoiler
''' 1. @ UIScript/MiniMap.py '''
# Search
				## ServerInfo
				{
					"name" : "ServerInfo",
					"type" : "text",

					"text_horizontal_align" : "center",

					"outline" : 1,

					"x" : 70,
					"y" : 140,

					"text" : "",
				},

# Add below
				## RTT Statistics
				{
					"name" : "RTTTextLine",
					"type" : "text",

					"x" : 0,
					"y" : 160,

					"horizontal_align" : "center",
					"text_horizontal_align" : "center",

					"text" : "",
					"outline" : 1,
				},
				{
					"name" : "PacketLossTextLine",
					"type" : "text",

					"x" : 0,
					"y" : 160 + 15,

					"horizontal_align" : "center",
					"text_horizontal_align" : "center",

					"text" : "",
					"outline" : 1,
				},

 


Links & Repository Updated.

Edited by Owsap
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • Web Developer

First of all, thank you for this release.

Since I use a hostname instead of an IP, this didn't work for me, this are the changes I made to make it work (also works with IP).

	CAccountConnector& rkAccountConnector = CAccountConnector::Instance();

	struct hostent* remoteHost;

	if ((remoteHost = gethostbyname(rkAccountConnector.GetServerAddr())) == NULL) {
#if defined(_DEBUG_RTT)
		TraceError("Unknown Hostname.\n\n");
#endif
		return; // Unkown Hostname
	}

	char* pDmsIP = inet_ntoa(*(struct in_addr*)(remoteHost->h_addr_list[0]));
	ipaddr = inet_addr(pDmsIP);

 

Edited by Karbust

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • Nitro Booster
28 minutes ago, Karbust said:

First of all, thank you for this release.

Since I use a hostname instead of an IP, this didn't work for me, this are the changes I made to make it work (also works with IP).

	CAccountConnector& rkAccountConnector = CAccountConnector::Instance();

	struct hostent* remoteHost;

	if ((remoteHost = gethostbyname(rkAccountConnector.GetServerAddr())) == NULL) {
#if defined(_DEBUG_RTT)
		TraceError("Unknown Hostname.\n\n");
#endif
		return; // Unkown Hostname
	}

	char* pDmsIP = inet_ntoa(*(struct in_addr*)(remoteHost->h_addr_list[0]));
	ipaddr = inet_addr(pDmsIP);

 

Thanks for contributing, I will update the repository soon.

Link to comment
Share on other sites

  • 3 months later...
  • Web Developer

Since not everyone has a good internet and there are instances when someone can have high ping, I think it shouldn't affect the game play capability in such cases, so I just added the ping code to a thread and now it doesn't block the game.

This is the hidden content, please

 

 

Edited by Karbust

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...
On 9/11/2021 at 7:46 PM, Karbust said:

First of all, thank you for this release.

Since I use a hostname instead of an IP, this didn't work for me, this are the changes I made to make it work (also works with IP).

	CAccountConnector& rkAccountConnector = CAccountConnector::Instance();

	struct hostent* remoteHost;

	if ((remoteHost = gethostbyname(rkAccountConnector.GetServerAddr())) == NULL) {
#if defined(_DEBUG_RTT)
		TraceError("Unknown Hostname.\n\n");
#endif
		return; // Unkown Hostname
	}

	char* pDmsIP = inet_ntoa(*(struct in_addr*)(remoteHost->h_addr_list[0]));
	ipaddr = inet_addr(pDmsIP);

 

Hi all, since my good friend @ Karbust forgot to mention (this mod work well btw and ty both), I've come to let you my small contribution, explaining how to implement.

His mod is done like this:

After implemented the full mod as @ Owsap explain, open the file
Client source -> in file ServerStateChecker.cpp

Search for:

ipaddr = inet_addr(strcmp(rkAccountConnector.GetServerAddr(), "localhost") == 0 ? "127.0.0.1" : rkAccountConnector.GetServerAddr());

 

and replace that* line (just that one) with all these given by @ Karbust :

	struct hostent* remoteHost;
	if ((remoteHost = gethostbyname(rkAccountConnector.GetServerAddr())) == NULL) {
#if defined(_DEBUG_RTT)
		TraceError("Unknown Hostname.\n\n");
#endif
		return; // Unkown Hostname
	}
	char* pDmsIP = inet_ntoa(*(struct in_addr*)(remoteHost->h_addr_list[0]));
	ipaddr = inet_addr(pDmsIP);


Work just fine for me.

EDIT: @Jimmermania you must have missed a step somewhere, verify again, or rollback to a previous backup and restart again.

Edited by davecosmo
Link to comment
Share on other sites



  • Similar Content

  • Activity

    1. 992

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    2. 3

      Biologist Manager (C++ & LUA)

    3. 3

      Visual studio 2022 compiling issue

    4. 63

      Metin2 | Mount System Renewal

    5. 58

      Metin2 2004 Beta Client

    6. 0

      🔥Paradise2 PVP SERVER GLOBAL!! EN-ES-PT 🕐📢Apertura 11 de diciembre 21 horas de España!

    7. 0

      Please help here ( Sush system problem )

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.