Server Lag Problem! What is the cause ? +REP
#1

This is my server log , used crashdetect and nativechecker.

Код:
SA-MP Dedicated Server
----------------------
v0.3.7, ©2005-2015 SA-MP Team

[21:50:01] filterscripts = ""  (string)
[21:50:01] 
[21:50:01] Server Plugins
[21:50:01] --------------
[21:50:01]  Loading plugin: crashdetect.dll
[21:50:01]   CrashDetect v4.15.1 is OK.
[21:50:01]   Loaded.
[21:50:01]  Loading plugin: sscanf.dll
[21:50:01] 

[21:50:01]  ===============================

[21:50:01]       sscanf plugin loaded.     

[21:50:01]          Version:  2.8.1        

[21:50:01]    © 2012 Alex "******" Cole  

[21:50:01]  ===============================

[21:50:01]   Loaded.
[21:50:01]  Loading plugin: whirlpool.dll
[21:50:01]  
[21:50:01]  ==================
[21:50:01]  
[21:50:01]   Whirlpool loaded
[21:50:01]  
[21:50:01]  ==================
[21:50:01]  
[21:50:01]   Loaded.
[21:50:01]  Loading plugin: streamer.dll
[21:50:01] 

*** Streamer Plugin v2.7.5.2 by Incognito loaded ***

[21:50:01]   Loaded.
[21:50:01]  Loading plugin: nativechecker.dll
[21:50:01]   Loaded.
[21:50:01]  Loaded 5 plugins.

[21:50:01] 
[21:50:01] Filterscripts
[21:50:01] ---------------
[21:50:01]   Loaded 0 filterscripts.

[21:50:01] 
 -Configuration Settings Loaded
[21:50:01]  -39 Forbidden Names Loaded
[21:50:01]  -10 Forbidden Tags Loaded
[21:50:01]  -9 Forbidden Words Loaded
[21:50:01] 
===================================================
[21:50:01]  Universal Warfare V1.7.8 - Nirzor
[21:50:01] ===================================================

[21:50:01] Number of vehicle models: 19
[21:50:23] [debug] Run time error 4: "Array index out of bounds"
[21:50:23] [debug]  Accessing element at index 4 past array upper bound 3
[21:50:23] [debug] AMX backtrace:
[21:50:23] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:50:50] [debug] Run time error 4: "Array index out of bounds"
[21:50:50] [debug]  Accessing element at index 4 past array upper bound 3
[21:50:50] [debug] AMX backtrace:
[21:50:50] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:51:17] [debug] Run time error 4: "Array index out of bounds"
[21:51:17] [debug]  Accessing element at index 4 past array upper bound 3
[21:51:17] [debug] AMX backtrace:
[21:51:17] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:51:45] [debug] Run time error 4: "Array index out of bounds"
[21:51:45] [debug]  Accessing element at index 4 past array upper bound 3
[21:51:45] [debug] AMX backtrace:
[21:51:45] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:52:12] [debug] Run time error 4: "Array index out of bounds"
[21:52:12] [debug]  Accessing element at index 4 past array upper bound 3
[21:52:12] [debug] AMX backtrace:
[21:52:12] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:52:39] [debug] Run time error 4: "Array index out of bounds"
[21:52:39] [debug]  Accessing element at index 4 past array upper bound 3
[21:52:39] [debug] AMX backtrace:
[21:52:39] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:53:07] [debug] Run time error 4: "Array index out of bounds"
[21:53:07] [debug]  Accessing element at index 4 past array upper bound 3
[21:53:07] [debug] AMX backtrace:
[21:53:07] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
[21:53:34] [debug] Run time error 4: "Array index out of bounds"
[21:53:34] [debug]  Accessing element at index 4 past array upper bound 3
[21:53:34] [debug] AMX backtrace:
[21:53:34] [debug] #0 001539f8 in public PingKick () at C:\Users\Emaz Ahmed\Desktop\0.3.7\gamemodes\COD9.pwn:23894
My server these days is lagging a bit. Is this the cause of the lag ? If it is then line no. 23894 is my PingKick system so is that causing the lagging problem ? And if the PingKick does the problem should I remove it?
Someone please give me a proper explanation why my server is lagging. +Rep back to anyone who can help me with this lag matter.
Reply
#2

Show us the line of PingKick. It seems there's an issue in the ping-kick scripting.
Reply
#3

Код:
public PingKick()
{
	if(ServerInfo[MaxPing] != 0)
	{
	    PingPos++; if(PingPos > PING_MAX_EXCEEDS) PingPos = 0;
		for(new i=0; i<MAX_PLAYERS; i++)
		{
			PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);

		    if(GetPlayerPing(i) > ServerInfo[MaxPing])
			{
				if(PlayerInfo[i][PingCount] == 0) PlayerInfo[i][PingTime] = TimeStamp();

	   			PlayerInfo[i][PingCount]++;
				if(TimeStamp() - PlayerInfo[i][PingTime] > PING_TIMELIMIT)
				{
	    			PlayerInfo[i][PingTime] = TimeStamp();
					PlayerInfo[i][PingCount] = 1;
				}
				else if(PlayerInfo[i][PingCount] >= PING_MAX_EXCEEDS)
				{
				    new Sum, x, string[128];
					while (x < PING_MAX_EXCEEDS) {
						Sum += PlayerInfo[i][pPing][x];
						x++;
					}
					//Average = (Sum / PING_MAX_EXCEEDS);
					format(string,sizeof(string),"%s has been kicked reason: High Ping (%d) |  Max Allowed (%d)", PlayerName2(i), GetPlayerPing(i), ServerInfo[MaxPing] );
  		    		SendClientMessageToAll(red,string);
					SaveToFile("KickLog",string);
					Kick(i);
				}
			}
			else if(GetPlayerPing(i) < 1 && ServerInfo[AntiBot] == 1)
		    {
				PlayerInfo[i][BotPing]++;
				if(PlayerInfo[i][BotPing] >= 3) BotCheck(i);
		    }
		    else
			{
				PlayerInfo[i][BotPing] = 0;
			}
		}
	}
		return 1;
}
This is my whole pingkick code ^.

This is the line which has problem. 23894 number line.

Код:
PlayerInfo[i][pPing][PingPos] = GetPlayerPing(i);
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=569534
Reply
#5

++PingPos;
PingPos %= PING_MAX_EXCEEDS;

change to that, you will be fine
Reply
#6

Already fixed.

Help me in this topic. https://sampforum.blast.hk/showthread.php?tid=575580
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)