Can't connect with underscores on the server...
#1

Hi,

This issue is still happening. I'm trying to get some help. Whenever I join or anyone joins the server it crashes and reloops on restarting whenever they have underscores in their name. Here's the OnPlayerConnect code
Код:
[public OnPlayerConnect(playerid)
{
    print("1");
    new gmtext[256];
 if(IsPlayerNPC(playerid)) return 1;
 F_OnPlayerConnect(playerid);
 print("2");
 PlayerInfo[playerid][CKed] = 0;
 PlayerInfo[playerid][CKed] = (dUserINT(ReturnPlayerName(playerid)).("CKed"));
 print("3");
 if(PlayerInfo[playerid][CKed] >= 1)
 {
  print("4");
  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;
 }
and when I connect the printf's show these numbers...
Код:
[12:25:50] Incoming connection: 71.86.92.193:49465
[12:25:50] [join] Dwan_Hawkins has joined the server (0:71.86.92.193)
[12:25:50] 1
[12:25:50] 2
[12:25:50] 3
Can anyone help me with this issue?
Reply
#2

What is CKed??
A theres a '[' before the public.

Possibly "array index out of bounds"??
Reply
#3

CK is character kill, and it came wrong. It's actually no [ infront of public OnPlayerConnect
Reply
#4

Show your enum. Sometimes tag mismatch can cause serious issues.
Reply
#5

This ?
Код:
new pInfo[MAX_PLAYERS][PlayInfo];
Also there's a registration immigration system too, you can connect with ie Dwan but not Dwan_Hawkins, soon as you do it crashes, and restart.... here's that code

Код:
	new PName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,PName,sizeof(PName));
	if(IsPlayerNPC(playerid) || (strcmp(ReturnPlayerName(playerid),"Araquiel",true) == 0))
	{

	}
	else
	{
	    new namestring = strfind(PName, "_", true);
	    new namestring2 = strfind(PName, "[", true);
	    new namestring3 = strfind(PName, "]", true);
	    new namestring4 = strfind(PName, "(", true);
	    new namestring5 = strfind(PName, ")", true);
	    new namestring6 = strfind(PName, "{", true);
	    new namestring7 = strfind(PName, "}", true);
	 	if(namestring == -1
		|| namestring2 != -1
		|| namestring3 != -1
		|| namestring4 != -1
		|| namestring5 != -1
		|| namestring6 != -1
		|| namestring7 != -1)
		{
			SendClientMessage(playerid, COLOR_RED, "Immigration Department: Your name is not acceptable.");
			SendClientMessage(playerid, COLOR_RED, "Hint: Your name must be in the format Firstname_Lastname. No tags!");
			SendClientMessage(playerid, COLOR_RED, "Example: John_Smith or Jane_Smith");
			SendClientMessage(playerid, COLOR_RED, "**Please change your name to be allowed to enter Ascendence:Roleplay!**");
			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
#6

Download crashdetect plugin and upload the log.
Reply
#7

Код:
[21:46:59]   <dmap> DMap 0.3 // © 2008 DracoBlue // http://www.dracoblue.net
[21:46:59]   <dmap> Loading ...
[21:46:59]   <dmap> .. done!
[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] -[  -A:RP-         
[21:47:00] -[ By: - Version §                          
[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
#8

[21:47:26] [debug] Run time error 4: "Array index out of bounds"
[21:47:26] [debug] Accessing element at negative index -50

My suspect was correct.

There are problems with your arrays.
Reply
#9

It dosen't say where it is? and plus the script compiles with no warnings or errors, so is the array -50 out of bounds?
Reply
#10

When you compile ,the compiler will not know what value the variable will hold at run time and therefore continues its normal compilation.

For example:
new a[10];
new b = 100;
a[b] = 'a'; //You wont get a compiler error but it will crash your server
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)