02.08.2012, 14:00
Код:
#include <a_samp> main(){} public OnGameModeInit() { UsePlayerPedAnims(); AddPlayerClass(0,488.1703,-14.2043,1000.6797,17.7887,-1,-1,-1,-1,-1,-1); return 1; } public OnPlayerRequestClass(playerid,classid) { SetSpawnInfo(playerid,1,0,2578.3943,1013.2123,10.4721,1.0,-1,-1,-1,-1,-1,-1); SpawnPlayer(playerid); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext,"/traf")==0) { new st[256]; for(new i=0;i<1000;i++) { format(st,sizeof(st),"%i",i); SendClientMessage(playerid,-1,st); } } return 1; }
when you enter command /traf, 1000 client messages will send you, but not instant, it will take few seconds
1 client message - 1 packet message
if you enter command again and again 1000 packet messages will be send faster and faster
Ofcource nobody will do this, but when you teleport to place with 500 objects, every object has SetMaterial, server will send you 1000 packet messages too, at this few seconds server didn't send any other packet type, chat will freeze, you will think it's lag
it's not connection problem or CPU problem, it's work same on localhost
on host you can test speed - download will be >1MB/s
it's not stable, server can send you 1000 messages instant, or 100 messages in second and take to it 10 sec
Why packet sending is limited by server? why server wait to send packages?