04.08.2015, 13:32
Past few weeks I have been changing the way I create things in my server, for example teams, zones, classes, ranks and so on.
In past, I was using method like this:
but recently I made it:
Same I did for teams, classes, ranks and other things.
However, after few hours, the server starts having delays of 0.5 seconds or so, but I can't find a reason why does it happen. RAM and CPU are normal, like before the update, nothing was added to the timers, only major change is, instead of using functions to get things like team name:
Now I use
The same for zones, ranks, classes and other.
Can somebody tell me what could be the possible causes for the lag?
I can't manage to find anything suspicious.
The loops look like this:
In loop, i = 1 because team id 0 is no_team, and -1 because one team doesn't have a base and is kinda like "one-man soldier".
Any tips on the possible causes are appreciated.
In past, I was using method like this:
Код:
CreateCaptureZone(.., ..., ..., ...) { ZoneInfo[...][..] = ...; ZoneInfo[...][..] = ...; ZoneInfo[...][..] = ...; ZoneInfo[...][..] = ...; }
Код:
new ZoneInfo[MAX_ZONES][zone_info]; { {.., .., .., ..}, {.., .., .., ..}, {.., .., .., ..} }
However, after few hours, the server starts having delays of 0.5 seconds or so, but I can't find a reason why does it happen. RAM and CPU are normal, like before the update, nothing was added to the timers, only major change is, instead of using functions to get things like team name:
Код:
TeamName(playerid) { new str[15]; switch(PlayerInfo[playerid][Team]) { case TEAM_USA: return str="USA"; ... .. } return str; }
Код:
TeamInfo[PlayerInfo[playerid][Team]][team_name]
Can somebody tell me what could be the possible causes for the lag?
I can't manage to find anything suspicious.
The loops look like this:
Код:
for(new i=0; i < sizeof(ZoneInfo); i++) { }
Код:
for(new i=1; i < sizeof(TeamInfo)-1; i++) { if(x == x) { PlayerInfo[playerid][x] = i; break; } }
Any tips on the possible causes are appreciated.