.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > POD-Bot mm > Releases, Installers, Docs & Coding
Releases, Installers, Docs & Coding Where the official development happens

Reply
 
Thread Tools
bug in bot naming
Old
  (#1)
Krush
Member
 
Status: Offline
Posts: 23
Join Date: Jul 2004
Default bug in bot naming - 06-07-2004

Don't know if anyone else has brought this up but the current way names are being handled does not work if a bot remains on server during and after a map change.

inside
Code:
void BotCreate (int bot_skill, int bot_team, int bot_class, const char *bot_name)
the else part where they are supplying the name
Code:
   // a name has been given
   else
   {
      // If Detailnames are on, attach Clan Tag
      if (g_bDetailNames)
      {
         if (iPersonality == 0)
            sprintf (c_name, "[POD]%s (%d)", bot_name, skill);
         else if (iPersonality == 1)
            sprintf (c_name, "[P*D]%s (%d)", bot_name, skill);
         else
            sprintf (c_name, "[P0D]%s (%d)", bot_name, skill);
      }
      else
         strncpy (c_name, bot_name, 32);
   }
has a bug cause in the case i describe the name already has the tag and skill on it

so for example say the name that we start with is "Bot"
first time through it makes it "[POD]Bot (54)"
but when the map change occurs you end up with "[POD][POD]Bot (54) (54)"
and the next map change "[POD][POD][POD]Bot (54) (54) (54)"

you get my point. this goes on until the name is so big the game crashes on server change.

a quick fix is to remove bots before the change. but a easier thing is to change that code up there to this:
Code:
   else
   {
      // If Detailnames are on, attach Clan Tag
      if (g_bDetailNames)
      {
         if (iPersonality == 0)
            sprintf (c_name, "%s", bot_name);
         else if (iPersonality == 1)
            sprintf (c_name, "%s", bot_name);
         else
            sprintf (c_name, "%s", bot_name);
      }
      else
         strncpy (c_name, bot_name, 32);
   }
if anyone has a better idea let me know
  
Reply With Quote
Re: bug in bot naming
Old
  (#2)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: bug in bot naming - 06-07-2004

thats an old bug.
what version do you have?
here's how it was fixed.
Code:
  // a name has been given
   else
   {
      // If Detailnames are on, see if we NEED to attach Clan Tag
      if (g_bDetailNames)
      {
         if ((strstr (bot_name, "[POD]") != NULL)
             || (strstr (bot_name, "[P*D]") != NULL)
             || (strstr (bot_name, "[P0D]") != NULL))
         {
            strncpy (c_name, bot_name, 32);

            if (bot_personality == 0)
               c_name[2] = 'O';
            else if (bot_personality == 1)
               c_name[2] = '*';
            else
               c_name[2] = '0';
         }
         else
         {
            if (bot_personality == 0)
               snprintf (c_name, 32, "[POD]%s (%d)", bot_name, skill);
            else if (bot_personality == 1)
               snprintf (c_name, 32, "[P*D]%s (%d)", bot_name, skill);
            else
               snprintf (c_name, 32, "[P0D]%s (%d)", bot_name, skill);
         }
      }
      else
         strncpy (c_name, bot_name, 32);
  
Reply With Quote
Re: bug in bot naming
Old
  (#3)
Krush
Member
 
Status: Offline
Posts: 23
Join Date: Jul 2004
Default Re: bug in bot naming - 06-07-2004

Not sure what version of the code i got I got it off the http://www.tnib.de/podbot/
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com