[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Compiling the server
. . -> [Subject]  Problems adding remort patch to quickmud
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Problems adding remort patch to quickmud

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Ramzi   (12 posts)  [Biography] bio
Date Sun 09 May 2004 07:32 PM (UTC)
Message
when compiling my const.c file keeps getting errors.

it keeps telling me the initializer element is not constant
and the initializer element is not computable at load time
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #1 on Sun 09 May 2004 08:50 PM (UTC)
Message
Can you paste us the actual error messages and the offending code block? Just a vague error reference isnt doing much good unless you just want us to guess what might be wrong.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #2 on Sat 22 May 2004 07:14 AM (UTC)
Message
mer.h:2362: warning: conflicting types for built-in function 'logf'
const.c:178: warning: missing braces around initiaizer
const.c:178: warning: (ner initialization for 'race_table[2]')
const.c:178: error: syntax error before '{' token
const.c:182: error: syntax error before nemeric constant
const.c:398: warning: initialization makes interger from pointer without a cast
const.c:398: error: initialzer element is not conputalbe at load time
const.c:398: error: (near initialization for 'class_table[0].remort_class')
const.c:398: error: initializer element is not constant
const.c:398: error: (ner initialization for 'class_table[0]')
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Sat 22 May 2004 11:20 PM (UTC)
Message
Please copy/paste instead of retyping it yourself.

Could you paste the lines of code it is referring to and let us know which ones have which line number?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #4 on Tue 08 Jun 2004 08:59 AM (UTC)
Message
ok i feel as though i have tried all i can do with this
this code was written for rom 24b4 and i can not get it to run with quickmud. I was wondering if there is anyplace i can get a patch already designated for a rom 24b6 such as quickmud
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #5 on Tue 08 Jun 2004 09:37 AM (UTC)
Message
btw i tried to write the code in as it stated for the remort patch aka patch.remort.rom24b4 and have been using quickmud i know i stink but any help would be great
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #6 on Tue 08 Jun 2004 03:33 PM (UTC)
Message
const.c:178: warning: missing braces around initiaizer

open up const.c and goto line 178, then cut and paste atleast 10 lines either side of it and post it here so we can see the code and point you in the right direction.

const.c:178: error: syntax error before '{' token

this error gives you an idea of where to start looking, but without the ability to see that line of code and a what lays befor it it is almost imposible to give any help at all. :)

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #7 on Fri 11 Jun 2004 09:36 AM (UTC)
Message
I got it i think got it to compile
was something stupid on my part.
thanks for your patients and understanding
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #8 on Fri 11 Jun 2004 10:34 AM (UTC)
Message
well i got my const.c file to compile here's the next problem
gcc -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/nanny.o nanny.c
In file included from nanny.c:52:
merc.h:2363: warning: conflicting types for built-in function `logf'
gcc -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/remort.o remort.c
In file included from remort.c:38:
merc.h:2363: warning: conflicting types for built-in function `logf'
remort.c: In function `do_remort':
remort.c:64: error: structure has no member named `confirm_remort'
remort.c:69: error: structure has no member named `confirm_remort'
remort.c:123: error: structure has no member named `confirm_remort'
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #9 on Fri 11 Jun 2004 10:35 AM (UTC)
Message
#if defined(macintosh)
#include <types.h>
#else
#include <sys/types.h>
#include <sys/time.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include "merc.h"

void do_remor( CHAR_DATA *ch, char *argument )
{
send_to_char( "If you want to REMORT, you must spell it out.\n\r", ch );
return;
}

void do_remort( CHAR_DATA *ch, char *argument )
{
DESCRIPTOR_DATA *d;
char strsave[MAX_INPUT_LENGTH], player_name[MAX_INPUT_LENGTH];
char player_pwd[MAX_STRING_LENGTH], buf[MAX_STRING_LENGTH];

if ( IS_NPC(ch) || ( d = ch->desc ) == NULL )
return;

if ( ch->level < LEVEL_HERO && !IS_SET( ch->act, PLR_REMORT ) )
{
sprintf( buf,
"You must be level %d to remort.\n\r",
LEVEL_HERO );
send_to_char( buf, ch );
return;
}

if ( ch->pcdata->confirm_remort )
{
if ( argument[0] != '\0' )
{
send_to_char( "Remort status removed.\n\r", ch );
ch->pcdata->confirm_remort = FALSE;
return;
}
else
{
/*
* Get ready to delete the pfile, send a nice informational message.
*/
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( ch->name ) );
stop_fighting( ch, TRUE );
send_to_char( "You have chosen to remort. You will now be dropped in at the race\n\r", ch );
send_to_char( "selection section of character creation, and will be allowed to choose from\n\r", ch );
send_to_char( "a wider selection of races and classes.\n\r\n\r", ch );
send_to_char( "In the unlikely event that you are disconnected or the MUD\n\r", ch );
send_to_char( "crashes while you are creating your character, create a new character\n\r", ch );
send_to_char( "as normal and write a note to 'immortal'.\n\r", ch );
send_to_char( "\n\r[Hit Enter to Continue]\n\r", ch );
wiznet( "$N has remorted.", ch, NULL, 0, 0, 0 );

/*
* I quote:
* "After extract_char the ch is no longer valid!"
*/
sprintf( player_name, "%s", capitalize( ch->name ) );
sprintf( player_pwd, "%s", ch->pcdata->pwd );
extract_char( ch, TRUE );

/*
* Delete the pfile, but don't boot the character.
* Instead, do a load_char_obj to get a new ch,
* saving the password. Then,
* set the PLR_REMORT bit and drop the player in at
* CON_BEGIN_REMORT.
*/
unlink( strsave );
load_char_obj( d, player_name );
d->character->pcdata->pwd = str_dup( player_pwd );
if( !IS_SET( ch->act, PLR_REMORT ) )
SET_BIT( ch->act, PLR_REMORT );
d->connected = CON_BEGIN_REMORT;
return;
}
}

if ( argument[0] != '\0' )
{
send_to_char( "Just type remort. No argument.\n\r", ch );
return;
}

send_to_char("Type remort again to confirm this command.\n\r", ch );
send_to_char("WARNING: This command is irreversible.\n\r", ch );
send_to_char("Typing remort with an argument will undo remort status.\n\r",
ch );
ch->pcdata->confirm_remort = TRUE;
wiznet( "$N is contemplating remorting.",ch,NULL,0,0,get_trust(ch));
}
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #10 on Fri 11 Jun 2004 11:28 AM (UTC)
Message
You didnt add confirm_remort to your char data structure or you didnt call it confirm_remort in the character struct, hard to say which without seeing the struct.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Ramzi   (12 posts)  [Biography] bio
Date Reply #11 on Fri 29 Oct 2004 05:07 AM (UTC)
Message
doh thanks
sorry about the late reply i have been away for a while
[Go to top] top

Posted by Terraco   (5 posts)  [Biography] bio
Date Reply #12 on Sat 20 Aug 2011 03:27 AM (UTC)
Message
Not to bring up a dead horse again. But as I see no post on the fix for this. I was wondering if someone could tell me how to fix the whole error: structure has no member named `history' the code is correct I just cant figure that error out.
As I added it to my code step by step:

Interp.h
DECLARE_DO_FUN( do_history );
DECLARE_DO_FUN( do_lookhist );

Interp.C
{ "history",    do_history,     POS_SLEEPING,   0,  LOG_NORMAL, 1 },
{ "lookhist",   do_lookhist,    POS_SLEEPING,   0,  LOG_NORMAL, 1 },

In Save.c
void fwrite_char( CHAR_DATA *ch, FILE *fp )
   if (ch->pcdata->history[0] != '\0' )
	fprintf( fp, "Hist %s~\n", ch->pcdata->history );

bool load_char_obj( DESCRIPTOR_DATA *d, char *name )
	ch->pcdata->history	= str_dup( "" );

fread_char( CHAR_DATA *ch, FILE *fp )
CASE 'H':
KEYS( "Hist",	ch->pcdata->history, fread_string( fp ) );

MERC.H -> in the pcdata structure
char *			history;

act_info.c

void do_history( CHAR_DATA *ch, char *argument )
{
    char buf[MSL], arg[MIL];

    if ( argument[0] != '\0' )
    {
	buf[0] = '\0';
	smash_tilde( argument );

    	if (argument[0] == '-')
    	{
            int len;
            bool found = FALSE;

            if (ch->pcdata->history == NULL || ch->pcdata->history[0] == '\0')
            {
                send_to_char("No lines left to remove.\n\r",ch);
                return;
            }

  			strcpy(buf,ch->pcdata->history);

            for (len = strlen(buf); len > 0; len--)
            {
                if (buf[len] == '\r')
                {
                    if (!found)  /* back it up */
                    {
                        if (len > 0)
                            len--;
                        found = TRUE;
                    }
                    else /* found the second one */
                    {
                        buf[len + 1] = '\0';
						free_string(ch->pcdata->history);
						ch->pcdata->history = str_dup(buf);
						send_to_char( "Your history is:\n\r", ch );
						page_to_char( ch->pcdata->history ? ch->pcdata->history :
						    "(None).\n\r", ch );
                        return;
                    }
                }
            }
            buf[0] = '\0';
			free_string(ch->pcdata->history);
			ch->pcdata->history = str_dup(buf);
			send_to_char("{RHistory cleared.{x\n\r",ch);
			return;
        }

		if ( argument[0] == '+' )
		{
		    if ( ch->pcdata->history != NULL )
				strcat( buf, ch->pcdata->history );

			argument++;

			while ( isspace(*argument) )
				argument++;
		}

    argument = one_argument( argument, arg );
    smash_tilde( argument );

    if ( !str_cmp( arg, "write") )
	{
		if ( argument[0] == '\0' )
	            string_append( ch, &ch->pcdata->history );
	    return;
	}

		if ( strlen(buf) >= 4096)
		{
			send_to_char( "History too long.\n\r", ch );
			return;
		}

		strcat( buf, argument );
		strcat( buf, "\n\r" );
		free_string( ch->pcdata->history );
		ch->pcdata->history = str_dup( buf );
	}

    send_to_char( "Your history is:\n\r", ch );
    page_to_char( ch->pcdata->history ? ch->pcdata->history : "(None).\n\r", ch );
    return;
}

void do_lookhist( CHAR_DATA *ch, char *argument )
{
  char arg1[MIL];
  CHAR_DATA *victim;

  argument = one_argument (argument, arg1);

  if (arg1[0] == '\0')
  {
      stc ("{rWhos history do you want to read?{x\n\r", ch);
      return;
  }

  if ((victim = get_char_world (ch, arg1)) == NULL)
  {
      stc ("{rThey aren't here.{x\n\r", ch);
      return;
  }

    stc( "Thier history is:\n\r", ch );
    page_to_char( victim->pcdata->history ? victim->pcdata->history : "(None).\n\r", ch );
    return;

}

[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Sat 20 Aug 2011 05:52 AM (UTC)
Message
This is a new problem, right? This is the first reference to "history" in this thread.

Sounds like the pcdata structure does not have a "history" member. I don't know enough about the patch to say why, or how to fix it. I would look carefully at the patch instructions to see if you skipped a step.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Terraco   (5 posts)  [Biography] bio
Date Reply #14 on Sat 20 Aug 2011 08:42 AM (UTC)
Message
This is indeed a new prob. I did a search for 30 min's before I posted. If you would like to look at the instructions you can find them @ http://www.mudbytes.net/index.php?a=pastebin&s=view&pid=48738 this should be the text view (no download required). I checked my code and its the same. I recently added another code (after commenting out the history one) and I get the same error. Kinda annoying at 3 AM lol
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,370 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]