Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Hotboot bug with d->user
Forum Rules | Mark all | Recent Posts

Hotboot bug with d->user
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 12, 2009, 7:23 am   Last edited Oct 12, 2009, 7:26 am by Banner
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Hotboot doesn't save the d->user variable, so it turns up as null after a hotboot which caused a few crashes for me until I found the problem.

Find, in do_hotboot:
/*                      For test purposes
                        flush_buffer(d, TRUE);*/
         fprintf( fp, "%d %d %d %d %s %s\n", d->descriptor, och->in_room->vnum, d->port, d->idle, och->name, d->host);
         /*
          * One of two places this gets changed
          */
         och->pcdata->hotboot = TRUE;
         save_char_obj( och );
         write_to_descriptor( d->descriptor, buf, 0 );
      }
   }


Make it so:
fprintf( fp, "%d %d %d %d %s %s %s\n", d->descriptor, och->in_room->vnum, d->port, d->idle, och->name, d->host, d->user);


Find, in hotboot_recover:
/* Recover from a hotboot - load players */
void hotboot_recover( void )
{
   DESCRIPTOR_DATA *d = NULL;
   FILE *fp;
   char name[100];
   char host[MAX_STRING_LENGTH];
   int desc, room, dport, idle, maxp = 0;
   bool fOld;


And:

     fscanf( fp, "%d %d %d %d %s %s\n", &desc, &room, &dport, &idle, name, host );



And:

      d->host = STRALLOC( host );  
      d->port = dport;
      d->idle = idle;
      LINK( d, first_descriptor, last_descriptor, next, prev );
      d->connected = CON_COPYOVER_RECOVER;   /* negative so close_socket will cut them off */


Make it so:

   DESCRIPTOR_DATA *d = NULL;
   FILE *fp;
   char name[100];
   char host[MAX_STRING_LENGTH], user[MAX_STRING_LENGTH];
   int desc, room, dport, idle, maxp = 0;
   bool fOld;



And:

     fscanf( fp, "%d %d %d %d %s %s %s\n", &desc, &room, &dport, &idle, name, host, user );


And:

      d->host = STRALLOC( host );  
      d->user = STRALLOC( user );
      d->port = dport;
      d->idle = idle;
      LINK( d, first_descriptor, last_descriptor, next, prev );
      d->connected = CON_COPYOVER_RECOVER;   /* negative so close_socket will cut them off */


You will need to reboot instead of using hotboot as recover will be attempting to read an extra variable that was not saved yet.
       
Post is unread #2 Oct 12, 2009, 9:08 am
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts144
JoinedJan 24, 2008

There is no d->user in SWRFUSS that I can find.
       
Post is unread #3 Oct 12, 2009, 10:19 am   Last edited Oct 12, 2009, 10:20 am by Caius
Go to the top of the page
Go to the bottom of the page

Caius
Magician
GroupMembers
Posts132
JoinedJan 29, 2006

The 'user' string in DESCRIPTOR_DATA appears in the original SWR, but has been removed in the FUSS version.
       
Post is unread #4 Oct 12, 2009, 11:06 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005


Caius said:

The 'user' string in DESCRIPTOR_DATA appears in the original SWR, but has been removed in the FUSS version.

Ah, then that would explain that away, so this doesn't pertain to recent versions.

Thanks Caius.
       
Post is unread #5 Oct 12, 2009, 11:55 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

One of the reasons it's too bad we didn't have SVN going back further than we do. We'd be able to look and see when this might have been done and maybe then remember why :)
       
Post is unread #6 Oct 12, 2009, 12:12 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005


Samson said:

One of the reasons it's too bad we didn't have SVN going back further than we do. We'd be able to look and see when this might have been done and maybe then remember why :)

So I take it it'd probably be a good idea to remove it from my code? I've never really seen it do anything as it always says unknown.
       
Post is unread #7 Oct 12, 2009, 12:26 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

That's probably why we (or I) took it out at some point. It didn't seem to have a purpose.

Oh wait. it just clicked. I bet it's a leftover from when the identd code was removed.
       
Pages:<< prev 1 next >>