Raised This Month: $ Target: $400
 0% 

Index out of bounds problem


Post New Thread Reply   
 
Thread Tools Display Modes
chungsy
Member
Join Date: Nov 2011
Old 03-20-2013 , 21:42   Re: Index out of bounds problem
Reply With Quote #11

Quote:
Originally Posted by fysiks View Post
That code is essentially the same as the first one you posted.



Where in my code do you see "g_szCfgs[g_iCounter]"? No where. You need to do exactly what I did with your array in place of g_szCfgs if you want to do it my way.

However, I'm starting to think you should stick with the method in post #5. It is correct and will work. If it doesn't work then [I already suggested reasons] and if those didn't solve the problem then you need to debug it. Print the values of g_iCounter after every line that uses g_iCounter.
I think I got the index out of bound fixed by using post #5 method.

But I'm still getting errors

L 03/20/2013 - 209:12: [AMXX] Run time error 5: memory access
L 03/20/2013 - 209:12: [AMXX] [0] server_query.inc::ServerResponseReadByte (line 230)
L 03/20/2013 - 209:12: [AMXX] [1] server_query.inc::ServerResponseParseInfo (line 119)
L 03/20/2013 - 209:12: [AMXX] [2] serversinfo.sma::cbInfo (line 48 )

For server_query.inc::ServerResponseParseInfo (line 119)

Code:
 new iType;
 new iTemp;
 new current = 0;
 current += ServerResponseReadByte(Response[current], iType);
For server_query.inc::ServerResponseReadByte (line 230)

Code:
stock ServerResponseReadByte(const Response[], &res)
{
 res = Response[0] & 0xFF;
 return 1;
}
And serversinfo.sma::cbInfo (line 48

Code:
ServerResponseParseInfo(Response, szName, 63, szMap, 63, szDirectory, 63, szDescription, 63, iPlayers, iMaxPlayers);

Last edited by chungsy; 03-20-2013 at 21:46.
chungsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-21-2013 , 01:49   Re: Index out of bounds problem
Reply With Quote #12

Then you need to post where you got those functions. The server_inquiry.inc that I have doesn't have any of those functions. Alternatively, you can switch to the include that I have (by Exolent in the Tutorials forum).
__________________

Last edited by fysiks; 03-22-2013 at 16:21.
fysiks is offline
chungsy
Member
Join Date: Nov 2011
Old 03-22-2013 , 03:40   Re: Index out of bounds problem
Reply With Quote #13

Scherzo's server_query.inc

https://forums.alliedmods.net/showthread.php?t=176775

Last edited by chungsy; 03-22-2013 at 03:41.
chungsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-22-2013 , 16:21   Re: Index out of bounds problem
Reply With Quote #14

Quote:
Originally Posted by chungsy View Post
Then you need to post in that thread if you are having issues with it.
__________________
fysiks is offline
chungsy
Member
Join Date: Nov 2011
Old 03-23-2013 , 02:37   Re: Index out of bounds problem
Reply With Quote #15

Quote:
Originally Posted by fysiks View Post
Then you need to post in that thread if you are having issues with it.
Scherzo's Last Activity was : 09-24-12


Is there another way to do this? with Exolent[jNr]'s server_query.inc maybe?

Last edited by chungsy; 03-23-2013 at 02:37.
chungsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-23-2013 , 04:03   Re: Index out of bounds problem
Reply With Quote #16

Quote:
Originally Posted by chungsy View Post
Scherzo's Last Activity was : 09-24-12
That is irrelevant, he's not the only one who can help with it. Also, that is not all that long ago.
__________________

Last edited by fysiks; 03-23-2013 at 04:04.
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode