ID 0 Bugs; SERVER: Unknown Command
#1

I'm experiencing some game breaking bugs that are significantly difficult to debug. I'm hoping to get some assistance from some of the more senior members of the board. Please note, I am a programmer by day. I won't be needing help in placing semi-colons. Here are the issues with my current game mode.

ID 0:
will become desynced. No one will be able to damage the player with ID 0, and ID 0 will be unable to damage other players.

SERVER: Unknown Command:
The script will run flawlessly for a given time interval (normally 1:30 - 4:00, perhaps this has something to do with Timers?), then it will return "SERVER: Unknown Command". Interestingly, if the server is left in this state for a given time interval (5 - 10 minutes), the script will begin parsing commands again.

Server Details:
Ubuntu 8.04 x86

Plugins:
G-sTyLeZzZ Alternative MySQL Plugin http://forum.sa-mp.com/index.php?topic=79352.0
MidoStream

I can post relevant code bits, but thus far I have been unable to narrow it down to a specific line. No compiler errors, nothing useful in the server_log.txt. Thanks for any help you can provide.
Reply
#2

Must be with a timer, do you have one running every 2 mins or so?
Reply
#3

Sounds like there's a filterscript or callback that's got a misplaced return or something. I'd troubleshoot by removing all filterscripts and check to see if the problem persists.
Reply
#4

Quote:
Originally Posted by Finn
Must be with a timer, do you have one running every 2 mins or so?
These are all instances of a SetTimer, or SetTimerEx in my current code.
Код:
pickuptexttimer = SetTimer("PickupTextTimer", 1000, 1);
minutetimer = SetTimer("MinuteTimer", 60000, 1);
onesecondtimer = SetTimer("OneSecondTimer", 1000, 1);

SetTimer("MoneySetTimer", 1000, 1);
SetTimer("AdvertisementTimer", 90000, false);
SetTimer("DrugTimer", 60000, 0);
Of those, AdvertisementTimer is most interesting as the time intervals seem to match up. Unfortunately, this is the complete code for AdvertisementTimer, and it definitely wouldn't crash the game mode.
Код:
public AdvertisementTimer()
{
  AdvertisementAllowed = 1;
}
Quote:
Originally Posted by Frank_Tesla
Sounds like there's a filterscript or callback that's got a misplaced return or something. I'd troubleshoot by removing all filterscripts and check to see if the problem persists.
No filterscripts are being used in tandem with this gamemode.
Reply
#5

Can we see minutetimer and drugtimer as well? Maybe there's a toggle in there that's causing the problem every other minute.
Reply
#6

What does AdvertisementAllowed do?
Reply
#7

It's processing three timers at the same time (1000) and then another two timers at the same time (60000), while these are processing the sync (Raknet) code isn't so this could result in a player not being sync'd correctly.
Reply
#8

public functions must always return a value. Start there.
Reply
#9

Quote:
Originally Posted by [M2S
moe ]
public functions must always return a value.
You're wrong.
Reply
#10

Quote:
Originally Posted by [M2S
moe ]
public functions must always return a value. Start there.
No they don't, start here.
Reply
#11

Hey movie makers, why dont you let the people who know what theyre talking about try n help cause you're obviously not doing a good job of it.

Make the function return a value, then post here and tell us if your problem is fixed.
Reply
#12

Quote:
Originally Posted by [M2S
moe ]
Hey movie makers, why dont you let the people who know what theyre talking about try n help cause you're obviously not doing a good job of it.

Make the function return a value, then post here and tell us if your problem is fixed.
I don't make movies, I make scripts for people to use when making movies (like debug scripts etc).

How have I failed to help here, was it the fact I corrected your false information or the fact that I understand how threading works ?
Reply
#13

The fact u seem to have no clue why your script bugs to begin with, seems like a damn good idea to listen to other scripters who've actually encountered bugs you may not know about.

However, you'll have to find someone else now
Reply
#14

Actually Donny is right

pawn Код:
forward Public();
public Public()
{
}
Holy crap I didnt return something
.
.
.
What will happen ?
Reply
#15

Quote:
Originally Posted by [M2S
moe ]
The fact u seem to have no clue why your script bugs to begin with, seems like a damn good idea to listen to other scripters who've actually encountered bugs you may not know about.

However, you'll have to find someone else now
Who me ?

If so then you are correct I have no clue about my script bugging as it's not my script it's Samgreens, you know the guy who posted in the first place with the issue

I think you need to read over the thread again, you are obviously confusing me with the original poster.

Quote:
Originally Posted by ♣ ⓐⓢⓢ
Actually Donny is right

pawn Код:
forward Public();
public Public()
{
}
Holy crap I didnt return something
.
.
.
What will happen ?
Thankyou.
Reply
#16

aaah, kids. Time will teach you things as you go on scripting for samp

Reply
#17

Quote:
Originally Posted by [M2S
moe ]
aaah, kids. Time will teach you things as you go on scripting for samp
Lol, viewing your replies and your scripts, i can say that you have poor knowledge of Pawn scripting.
Reply
#18

If mighty 10 yr olds like you say so, it must be true
Reply
#19

Stop being a dickhead and grow up.
Reply
#20

First of all, I don't appreciate the thread hijacking. Please keep your private matters to PMs. Attached are my replies to the relevant comments. Many public functions in my script do not return values. These bugs are a recent development, and SVN indicates that code for these functions are many many revisions behind. Just to be certain, I have altered the script to return values from all my public functions. The ID 0 bug is still present.

Quote:
Originally Posted by Frank_Tesla
Can we see minutetimer and drugtimer as well? Maybe there's a toggle in there that's causing the problem every other minute.
Код:
public MinuteTimer()
{	
	// Update server time
	new NewServerTime[3];
	gettime(NewServerTime[0], NewServerTime[1], NewServerTime[2]);
	
	// Has an hour elapsed?
	if((NewServerTime[0] > ServerTime[0]) || (NewServerTime[0] == 0 && ServerTime[0] == 23)) {
		ServerTime[0] = NewServerTime[0];
		ServerTime[1] = NewServerTime[1];
		ServerTime[2] = NewServerTime[2];
		NewServerTime[0] = 0;
		NewServerTime[1] = 0;
		NewServerTime[2] = 0;
		SetWorldTime(ServerTime[0]);
		
		SetUpPayday();		
	}
	
  for(new i=0; i<MAX_PLAYERS;i++)
  {
    if(LogConCheck(i))
    {			
			MySQLSynchronizePlayer(i);
			
      if(gPlayerInfo[i][MiningTime] > 0) {
				gPlayerInfo[i][MiningTime] -= 1;
			}
			if(gPlayerInfo[i][CropDusterTime] > 0) {
				gPlayerInfo[i][CropDusterTime] -= 1;
			}
			if(gPlayerInfo[i][JailTime] > 0) {
				gPlayerInfo[i][JailTime]--;
				
				if(gPlayerInfo[i][JailTime] == 0) {
					OnPlayerSpawn(i);
					SetPlayerInterior(i, 0);
				}
			}
			if(ScrapCarTime[i] > 0) {
				ScrapCarTime[i]--;
			}
			if(RepairTime[i] > 0) {
				RepairTime[i]--;
			}
			
      if(gPlayerInfo[i][MiningTime] == 0){HasMined[i] = 0;}
			if(gPlayerInfo[i][CropDusterTime] == 0){HasDusted[i] = 0;}
			if(JobContractTime[i] > 0){JobContractTime[i] -= 1;}
      gPlayerInfo[i][ConnectedTime]++;
		}  
  }
	
	return 1;
}
Код:
public DrugTimer()
{
  for (new i = 0; i<MAX_PLAYERS; i++)
  {
    if(UsedDrugs[i] == 1)
    {
			SetPlayerWeather(i, WorldWeather);
			DestroyPickup(pill[i]);
			for (new x; x<MAX_VEHICLES;x++)
  		{
  		  SetVehicleParamsForPlayer(x,i,0,0);
  		}
  		UsedDrugs[i] = 0;
		}
	}
	
	return 1;
}
As you wish. MySQLSynchronizePlayer() is a function used to synchronize live player data with our SQL backend.

Quote:
Originally Posted by Finn
What does AdvertisementAllowed do?
AdvertisementAllowed is a global variable used to indicate whether /ad is currently allowed. We only allow advertisements every ninety seconds in our server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)