Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Weird mervbot bug...

 
Post new topic   Reply to topic Printable version
 View previous topic  Source Code Post :: Post Anti-warp not working...  View next topic  
Author Message
Tommyhawk
Newbie


Joined: Jul 14 2004
Posts: 14
Offline

PostPosted: Mon Jul 26, 2004 11:04 pm    Post subject: Weird mervbot bug... Reply to topic Reply with quote

I have a really odd thing happening in one of my MervBot plugins. When I declare a variable at the top of the botInfo class I get really random and erratic values for it as if the memory its located at is being accessed and changed while the bot is running, even though I never change it (or at least don't change it to the values its being set at) and I've initialized it in the botInfo constructor. The only way around it is to declare a bunch of dummy variables that I don't use before I start declaring the actual variables I want. For example,

Code: Show/Hide
class botInfo
{
   bool CONNECTION_DENIED;

   CALL_HANDLE handle;
   CALL_COMMAND callback;
   CALL_PLIST playerlist;
   CALL_FLIST flaglist;
   CALL_MAP map;
   CALL_BLIST bricklist;
   char *arena;
   arenaSettings *settings;
   Player *me;
   bool biller_online;

   objectInfo object_array[MAX_OBJECTS];
   int num_objects;
   Player *object_dest;

   int countdown[7];

   // Put bot data here
   Player *nothing[2000];  ////// DUMMY PLAYER OBJECTS /////

   int f0capttimer;
   int f1capttimer;
   int capt0vote;
   int capt1vote;


The Player *nothing[2000] is there just so my f0capttimer, f1capttimer, etc.. variables will work but occaisonally they still get set to crazy values. This doesn't happen with every plugin I've made, but it is with this one and for the life of me I can't figure out why. I've even compared my spawn.h line for line with other plugins I've made and I can't notice anything that could cause this. Has anyone seen this before or have any idea whats going on?
Back to top
View users profile Send private message Add User to Ignore List
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Mon Jul 26, 2004 11:14 pm    Post subject: Reply to topic Reply with quote

Something is likely going out of bounds in the object_array[] or countdown[].
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:37
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Mon Jul 26, 2004 11:16 pm    Post subject: Reply to topic Reply with quote

Meh, I was seeing if that could be the problem, pfft. icon_razz.gif
Back to top
View users profile Send private message Add User to Ignore List
Guest



Offline

PostPosted: Tue Jul 27, 2004 2:08 am    Post subject: Reply to topic Reply with quote

post the entire source
Back to top
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Tue Jul 27, 2004 3:08 am    Post subject: Reply to topic Reply with quote

i wonder why you'd need 2000 Player objects anyways?

Definately post up your source code so we can take a better look at it.
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue Jul 27, 2004 4:33 am    Post subject: Reply to topic Reply with quote

yah, there is no way you need that many pointers. THere will never be 2k people in one arena. Use a linklist
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Tue Jul 27, 2004 4:39 am    Post subject: Reply to topic Reply with quote

CypherJF wrote:
i wonder why you'd need 2000 Player objects anyways?

Definately post up your source code so we can take a better look at it.

50% Packetloss wrote:
yah, there is no way you need that many pointers. THere will never be 2k people in one arena. Use a linklist

Pay attention guys, the player objects are just dummy memory fillers.

Not really adding anything here, but I'd agree with Ekted in that it's most likely an out of bounds. Take a look at where you're accessing them, and if you can't find a problem post your spawn.cpp (and command.cpp?) too
_________________
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Tue Jul 27, 2004 8:39 am    Post subject: Reply to topic Reply with quote

Or maybe the header files you have don't match the version of merv that you run your plugins with.

Since nothing is a pointer, you could just do 'void *dummy[2000]' which would take the same amount of memory.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Tommyhawk
Newbie


Joined: Jul 14 2004
Posts: 14
Offline

PostPosted: Tue Jul 27, 2004 4:26 pm    Post subject: Reply to topic Reply with quote

Well I was having this problem for MONTHS and now its gone and I don't know why. I'll probably let you know if it happens again. Thanks for the help anyway.
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Tue Jul 27, 2004 5:24 pm    Post subject: Reply to topic Reply with quote

.shrug.

I knew they were just dummy pointers; but still...
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 97 page(s) served in previous 5 minutes.

phpBB Created this page in 0.460411 seconds : 34 queries executed (89.8%): GZIP compression disabled