Underscore issue
#1

Hi,

I try to connect with underscores, and my server loops on restarting.. And running crashdetect plugin I came with this, any ideas ? Also I can run it on a windows OS fine, but Linux we can't connect with underscores

Код:
[21:47:00] [debug] Run time error 4: "Array index out of bounds"
[21:47:00] [debug]  Accessing element at index 65535 past array upper bound 1999
[21:47:00] [debug] AMX backtrace:
[21:47:00] [debug] #0 0000b1b4 in ?? () from Aegis.amx
[21:47:00] [debug] #1 0000a8f8 in ?? () from Aegis.amx
[21:47:00] [debug] #2 0004d1d4 in public OnGameModeInit () from Aegis.amx
[21:47:00]  
[21:47:00] -[ AA:RP   
[21:47:00] -[ By                        
[21:47:00]  
[21:47:00] Number of vehicle models: 69
[21:47:26] Incoming connection: 71.86.92.193:60174
[21:47:26] [join] Dwan_Hawkins has joined the server (0:71.86.92.193)
[21:47:26] [debug] Run time error 4: "Array index out of bounds"
[21:47:26] [debug]  Accessing element at negative index -50
[21:47:26] [debug] AMX backtrace:
[21:47:26] [debug] #0 00000630 in ?? () from araquiel.amx
[21:47:26] [debug] #1 00000288 in public OnPlayerConnect () from araquiel.amx
[21:47:26] [debug] Server crashed while executing Aegis.amx
[21:47:26] [debug] AMX backtrace:
[21:47:26] [debug] #0 native fclose () [0809a900] from samp03svr
[21:47:26] [debug] #1 00006298 in ?? () from Aegis.amx
[21:47:26] [debug] #2 0007774c in ?? () from Aegis.amx
[21:47:26] [debug] #3 0000cf20 in public OnPlayerConnect () from Aegis.amx
[21:47:26] [debug] System backtrace:
[21:47:26] [debug] #0 0017af41 in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[21:47:26] [debug] #1 0017141f in _ZN11crashdetect20PrintSystemBacktraceEPv () from plugins/crashdetect.so
[21:47:26] [debug] #2 0016f963 in _ZN11crashdetect15SystemExceptionEPv () from plugins/crashdetect.so
[21:47:26] [debug] #3 0017a3c1 in ?? () from plugins/crashdetect.so
[21:47:26] [debug] #4 0038a410 in ?? ()
[21:47:26] [debug] #5 00974877 in fclose () from /lib/libc.so.6
[21:47:26] [debug] #6 0809a914 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #7 08093c94 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #8 001705a2 in _ZN11crashdetect13DoAmxCallbackEiPiS0_ () from plugins/crashdetect.so
[21:47:26] [debug] #9 0017865e in ?? () from plugins/crashdetect.so
[21:47:26] [debug] #10 0017f926 in amx_Exec () from plugins/crashdetect.so
[21:47:26] [debug] #11 00170622 in _ZN11crashdetect9DoAmxExecEPii () from plugins/crashdetect.so
[21:47:26] [debug] #12 00178699 in ?? () from plugins/crashdetect.so
[21:47:26] [debug] #13 080acdd9 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #14 080c4bdf in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #15 080bbb9c in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #16 08071ae8 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #17 08071be2 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #18 0807ba00 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #19 080b59ad in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #20 080b5b42 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #21 080b1453 in ?? () from /home/tcagame/josephk/211/samp03svr
[21:47:26] [debug] #22 0092ace6 in __libc_start_main () from /lib/libc.so.6
[21:47:26] [debug] #23 0804b521 in ?? () from /home/tcagame/josephk/211/samp03svr
Reply
#2

Anyone?? :/
Reply
#3

Show us the code in OnPlayerConnect
Reply
#4

Код:
public OnPlayerConnect(playerid)
{

    new gmtext[256];
 if(IsPlayerNPC(playerid)) return 1;
 F_OnPlayerConnect(playerid);

 PlayerInfo[playerid][CKed] = 0;
 PlayerInfo[playerid][CKed] = (dUserINT(ReturnPlayerName(playerid)).("CKed"));
 if(PlayerInfo[playerid][CKed] >= 1)
 {
  SendClientMessage(playerid, COLOR_RED, "Aegis Quality Control Notice");
  SendClientMessage(playerid, COLOR_RED, "This name is flagged as CK'd [Character Killed]");
  SendClientMessage(playerid, COLOR_RED, "Please create a new character by choosing a new name and registering, thank you.");
  PlayerInfo[playerid][TimeX] = 0;
  //Kick(playerid);
  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Name Change", "Incorrect Name, please retry.\nExample: John_Smith or Jane_Smith", "Accept", "Cancel");
  return 1;
 }
Reply
#5

nd whats doin this F_OnPlayerConnect(playerid); ?
Reply
#6

We don't know what's doing this here's the OnGameModeInit as well.

Код:
public OnGameModeInit()
{
	AntiDeAMX();
    F_OnInit();
//	StartSystem();
	dmap_GameModeInit();
	
	SetTimer("IconCheck", 1000, true);

    ManualVehicleEngineAndLights();
Reply
#7

It's probably an include.
So it's not causing the problem.
Reply
#8

Yes, it's an include; but do you know what's causing the server to crash when we try to log in with an underscore? it works on windows just fine, but Linux it crashes with the underscore
Reply
#9

Then wouldn't it make sense to look at the function that checks the underscore in the first place?
Reply
#10

ahh lol @Vince is right why are you even testing it?
If you think that would be a bug, so whenever you give a negative score check if he has it:

Example:
pawn Код:
stock GivePlayerScore(playerid, score)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
    return 1;
}

//a command or whatever
if(GetPlayerScore(playerid) > 10)
{
         GivePlayerScore(playerid,-10);
}
else SetPlayerScore(playerid,0);
Edit :
pawn Код:
//just wanna edit my post this may be better
stock GivePlayerNegativeScore(playerid, score)
{
        if(GetPlayerScore(playerid) > score)
        {
               SetPlayerScore(playerid, GetPlayerScore(playerid)-score);
        }
        else return SetPlayerScore(playerid,0);
    return 1;
}
And it's solved i hope!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)