Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
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
Users Online
CommonCrawl, DotBot, Yahoo!

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » The port define documentation.
Forum Rules | Mark all | Recent Posts

The port define documentation.
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jul 11, 2002, 2:29 pm   Last edited Nov 24, 2007, 11:31 am by Samson
Go to the top of the page
Go to the bottom of the page

barbus_007

GroupMembers
Posts16
JoinedJun 23, 2002

Here:
This removes the port checking and dependancy from AFKMUD from 1.2b.
Version 2.0 (1.0 was horribly written) by Zelse aka barbus_007.

AFKMUD, by default, is set up to have
three different copies of the server running.
This is memory intensive and costly and most hosts can't afford it.
The code is written so some commands can only be used on certain ports.
Some people probably don't want this, and some can't afford it.
This guide shows how to remove the support without doing any damage.
This has been tested on my shell by myself.

1stly, you'll need to open up AFKmud.h
and change
the
#define BUILDPORT
#define CODEPORT
#define MAINPORT
to the ports you'd use if you wanted it (mainport should be the port your using).

Then you want to change all the commands related to codeport/backup
so they will save to the right area:
Open up shell.h
and change #define HOST_DIR your $HOME/wherever_afkmud_is
by default this would be /home/yourusername/afkmud/ (the end slash should be there).
Now I reccommend going into the directory you just defined
and create a dir named bkup and inside it create
directories named: maps, src, areas, system, classes, races, and deity.
Now you'll want to change all of the defines in shell.h to look
like this:
/* Change this line to the home directory for the server - Samson */
#define HOST_DIR 	"/home/joeuser/afkmud/"

/* Change this line to the name of your compiled binary - Samson */
#define BINARYFILE "smaug"

/* Change each of these to reflect your directory structure - Samson */

#define CODEZONEDIR	HOST_DIR "bkup/areas/" /* Used in do_copyzone - Samson 8-22-98 */
#define BUILDZONEDIR	HOST_DIR "bkup/areas/" /* Used in do_copyzone - Samson 4-7-98 */
#define MAINZONEDIR	HOST_DIR "area/" /* Used in do_copyzone - Samson 4-7-98 */
#define TESTCODEDIR     HOST_DIR "bkup/src/" /* Used in do_copycode - Samson 4-7-98 */
#define BUILDCODEDIR    HOST_DIR "bkup/src/" /* Used in do_copycode - Samson 8-22-98 */
#define MAINCODEDIR	HOST_DIR "afkmud/src/" /* Used in do_copycode - Samson 4-7-98 */
#define CODESYSTEMDIR   HOST_DIR "bkup/system/" /* Used in do_copysocial - Samson 5-2-98 */
#define BUILDSYSTEMDIR  HOST_DIR "bkup/system/" /* Used in do_copysocial - Samson 5-2-98 */
#define MAINSYSTEMDIR   HOST_DIR "system/" /* Used in do_copysocial - Samson 5-2-98 */
#define CODECLASSDIR	HOST_DIR "bkup/classes/" /* Used in do_copyclass - Samson 9-17-98 */
#define BUILDCLASSDIR	HOST_DIR "bkup/classes/" /* Used in do_copyclass - Samson 9-17-98 */
#define MAINCLASSDIR	HOST_DIR "classes/" /* Used in do_copyclass - Samson 9-17-98 */
#define CODERACEDIR	HOST_DIR "bkup/races/" /* Used in do_copyrace - Samson 10-13-98 */
#define BUILDRACEDIR	HOST_DIR "bkup/races/" /* Used in do_copyrace - Samson 10-13-98 */
#define MAINRACEDIR	HOST_DIR "races/" /* Used in do_copyrace - Samson 10-13-98 */
#define CODEDEITYDIR	HOST_DIR "bkup/deity/" /* Used in do_copydeity - Samson 10-13-98 */
#define BUILDDEITYDIR	HOST_DIR "bkup/deity/" /* Used in do_copydeity - Samson 10-13-98 */
#define MAINDEITYDIR	HOST_DIR "deity/" /* Used in do_copydeity - Samson 10-13-98 */
#define MAINMAPDIR	HOST_DIR "maps/" /* Used in do_copymap - Samson 8-2-99 */
#define BUILDMAPDIR	HOST_DIR "bkup/maps/" /* Used in do_copymap - Samson 8-2-99 */
#define CODEMAPDIR	HOST_DIR "bkups/maps/" /* Used in do_copymap - Samson 8-2-99 */

These means whenever you use a backup or export command, the backup
will be dumped in 'HOST_DIR/bkup/thedirectory'.
Now you'll need to go through the code and comment out the
checks for the ports, allowing all commands to be used on the main port,
to do this, open up the following files and modify them.
I've tried to provide as detailed data as possible:

Mainport references:

In act_wiz.c one exists for rare item loading, I left this one alone.
You can remove it if you want:
act_wiz.c:
Line 3620:
if ( pObjIndex->rent >= sysdata.minrent && port == MAINPORT )
    {
      if( !IS_IMP( ch ) )
	{
	  send_to_char( "Loading of rare items is restricted to KLs and above on this port.\r\n", ch );
        return;
	}
	else
	{
	  ch_printf( ch, "WARNING: This item has rent exceeding %d! Destroy this item when finished!\r\n", sysdata.minrent );
	  sprintf( log_buf, "do_load: %s has loaded a copy of vnum %d.", ch->name, pObjIndex->vnum );
	  log_string( log_buf );
	}

Change to:
if ( pObjIndex->rent >= sysdata.minrent )

I didn't do this one.

afk.c:
Line 3174:
    if ( port == MAINPORT )
    {
	send_to_char( "Vassign is disabled on this port.\r\n", ch );
	return;
    }

Just remove it or comment it out. If you remove it you
might want to put something like /* Port check removed. --Yourname */
so you can find it later.
In comm.c there is also a switch
statement for MAINPORT, CODEPORT and BUILDPORT.
I left it alone as it doesnt restrict anything and I don't like messing
with comm.c especially init_mud.
There is also (again in comm.c) another statement about mainport
for making sure only imms can get on other ports. Again, just leave it.

overland.c:
878:
   if( port == MAINPORT )
   {
	send_to_char( "This command is not available on this port.\r\n", ch );
	return;
   }

Remove or comment it out.
1258:
   if( port == MAINPORT )
   {
	send_to_char( "This command is not available on this port.\r\n", ch );
	return;
   }

Remove or comment it out.
1728:
   if( port == MAINPORT )
   {
	send_to_char( "This command is not available on this port.\r\n", ch );
	return;
   }

Remove or comment it out.
3460:
   if( port == MAINPORT )
   {
	send_to_char( "This command is not available on this port.\r\n", ch );
	return;
   }

Remove or comment it out.

Buildport references:

act_wiz.c:
5340:
   if ( port != BUILDPORT && !IS_IMP(ch) )
    {
	send_to_char( "Only an implementor may bestow an area on this port.\r\n", ch );
	return;
    }

Remove or comment it out.

comm.c
One exists in a switch statement, again, I didn't try it.
Line 412 if your interested.

hotboot.c:
621:
   if( port == BUILDPORT )
   {
	log_string( "Saving modified area files..." );
      save_areas();
   }

Remove or comment it out.

reset.c
1436:
  if ( port != BUILDPORT )
  {
    send_to_char( "Instaroom is disabled on this port.\r\n", ch );
    return;
  }

Remove or comment it out.
1479:
  if ( port != BUILDPORT )
  {
    send_to_char( "Instazone is disabled on this port.\r\n", ch );
    return;
  }

Remove or comment it out.

shell.c -- Alot of them (you'll find alot in here for CODEPORT too)
350:
   if ( port != BUILDPORT )
   {
	send_to_char( " copyclass command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
464:
   if ( port != BUILDPORT )
   {
	send_to_char( " copyzone command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
564:
   if ( port != BUILDPORT )
   {
	send_to_char( " copymap command may only be used from the Builders' port.\r\n", ch );
	return;
   }

642:
   if ( port != BUILDPORT )
   {
	send_to_char( " copybits command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
683:
   if ( port != BUILDPORT )
   {
	send_to_char( " copysocial command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
728:
   if ( port != BUILDPORT )
   {
	send_to_char( " copyslay command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
774:
   if ( port != BUILDPORT )
   {
	send_to_char( " copymorph command may only be used from the Builders' port.\r\n", ch );
	return;
   }

Remove or comment it out.
878:
   if ( port != BUILDPORT )
   {
	send_to_char( " copyrace command may only be used from the Builders' Port.\r\n", ch );
	return;
   }

Remove or comment it out.
949:
   if ( port != BUILDPORT )
   {
	send_to_char( " copydeity command may only be used from the Builders' Port.\r\n", ch );
	return;
   }

Remove or comment it out.

Codeport references:
There is a define
in the switch statement in comm.c
It's below the one for buildport (line 414) if
you want to remove it.
I didn't.

shell.c
300:
   if ( port != CODEPORT )
   {
	send_to_char( " compiler can only be run on the code port.\r\n", ch );
	return;
   }

Remove or comment it out.

819:
   if ( port != CODEPORT )
   {
	send_to_char( " copycode command may only be used from the Code Port.\r\n", ch );
	return;
   }

Remove or comment it out.

Recompile the mud and you have removed the dependancy.
       
Post is unread #2 Jul 11, 2002, 9:45 pm
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

Thank you

I have been too scared to try and find all the bits myself

things like instazone etc.. that wont work on the main port

maybe now I can get them to work

Kilroy
       
Post is unread #3 Jul 11, 2002, 11:56 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Here:
This removes the port checking and dependancy from AFKMUD from 1.2b.
Version 2.0 (1.0 was horribly written) by Zelse aka barbus_007.

AFKMUD, by default, is set up to have
three different copies of the server running.
This is memory intensive and costly and most hosts can't afford it.
The code is written so some commands can only be used on certain ports.
Some people probably don't want this, and some can't afford it.
This guide shows how to remove the support without doing any damage.
This has been tested on my shell by myself.

[snipped out vast quantities of instructions]

Recompile the mud and you have removed the dependancy.

Firstly, let me open by saying I will be tweaking this to allow for easy on/off support via the Makefile. That said.....

The multiport functions are NOT required for the mud to operate, so the apparent assumption that they are is false. You could just as easily have undone the individual command checks without messing with the rest of it and not caused a problem. Either way, it'll be fixed and easily disabled when the next patch comes along.

Also, the myriad of stuff in shell.c is largely only for use with the multiport. So if you go about removing the defines, none of it will work right. I'd suggest leaving this alone until the next patch is available. Which unfortunately may be awhile longer since I still have some other stuff to complete before that can happen.

Oh, and the duplicate of this post was removed
       
Post is unread #4 Jul 12, 2002, 6:38 pm
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

okay
Thanks Samson
will wait for your update.

Kilroy
       
Post is unread #5 Jul 14, 2002, 9:27 pm
Go to the top of the page
Go to the bottom of the page

barbus_007

GroupMembers
Posts16
JoinedJun 23, 2002

Yep, my wording was flawed, I agree and apologize for making it look like that, and I'd
figured you would have something like that in the works.
My document was mainly meant to be a quick fix, I mainly modified the stuff in shell.c
so that the copy functions and whatnot became archival functions.
Hopefully it helped a person or two.
Thanks for deleting the duplicate post (clicked the button one time too many methinks).
       
Post is unread #6 Jul 14, 2002, 9:28 pm
Go to the top of the page
Go to the bottom of the page

barbus_007

GroupMembers
Posts16
JoinedJun 23, 2002

Hmm..I'm glad I kept a clean copy of shell.c in that case.
Thanks for the info.
       
Pages:<< prev 1 next >>