Project L: Core program

by Unknown

Back to Project L.

Unknown2005-12-28 03:46:57
This topic will hopefully be about changes that are necessary to upgrade the main mudbot program to suit Lusternia. There are a couple of preliminary changes that I can see might be useful right away, these are as follows:

main.c - variable definitions
QUOTE

/* ATCP. */
int a_hp, a_mana, a_end, a_will, a_exp;
int a_max_hp, a_max_mana, a_max_end, a_max_will;


/* (Lusternia): ADDED MAX EGO & POWER*/
int a_max_ego, a_ego, a_power;


char a_name, a_title;
int a_on;




main.c - *get_variable( char *name )
QUOTE

  struct {
      char *name;
      void *var;
  } variables =
    {
/* ATCP */
  { "a_on", &a_on },
  { "a_hp", &a_hp },
  { "a_max_hp", &a_max_hp },
  { "a_mana", &a_mana },
  { "a_max_mana", &a_max_mana },
  { "a_exp", &a_exp },

/* (Lusternia): ADDED EGO & POWER TERMS */
  { "a_max_ego", &a_max_ego },
  { "a_ego", &a_ego },
  { "a_power", &a_power },


  { NULL, NULL }
    }, *p;




main.c - *handle_atcp( char *msg )
QUOTE

  /* Bleh, has a newline after it too. */
  else if ( !strncmp( act, "Char.Vitals", 10 ) )
    {

/* (Lusternia): I found I had to prevent this variable being turned on, otherwise
                connecting via Nexus hangs at the login screen. Any suggestions
                for a fix? */                 
// if ( !a_on )
//  a_on = 1;


if ( !body )
  {
      debugf( "No Body!" );
      return;
  }

/* (Lusternia): MODIFIED TO SUIT LUSTERNIA ATCP */

sscanf( body, "NL:%d/100 H:%d/%d M:%d/%d E:%d/%d P:%d/10 N:%d/%d W:%d/%d",
  &a_exp, &a_hp, &a_max_hp, &a_mana, &a_max_mana, &a_ego, &a_max_ego, &a_power,
  &a_end, &a_max_end, &a_will, &a_max_will );
    }

  if ( !strncmp( act, "Char.Name", 9 ) )
    {

/* (Lusternia): As above. */                 
// if ( !a_on )
//  a_on = 1;



Trakis2006-01-04 06:54:55
I think the very very very VERY first step should be to strip the code down to being a simple proxy that relays text from the server to the mud client. We can play around with it after that to make MudMaster do easy things for us, so we're taking baby steps.

I don't think we should start editing the code until it's been stripped down and everything relating to Imperian has been done away with.

We can always look at the original code later to see how Whyte wrote certain processes, etc.

I just feel that if we start from scratch, we wouldn't waste nearly as much time looking through the code and deleting little things that aren't needed whenever we find them.

Thoughts?
Unknown2006-01-04 07:09:50
Well, that could be a good idea.

My inclination was to build on Whyte's existing system just because I don't have quite the same level of knowledge in creating modular applications, but if you guys have it in you, that would be great! You could create a base system that is entirely designed for Lusternia, maybe taking advantage of any unique protocols it has.

Remember though that the main program is designed to be modular, so if we can perhaps ask Whyte to adjust some of the Imperian-only features of the existing client-server application, we could simply add on Lusternian healing/mapping/fighting modules and take advantage of any updates made to the main program.

Really, I'm happy to go either way. tongue.gif What do others think?
Anumi2006-01-04 18:21:41
I only recently started looking at Mudbot, from the perspective of creating a module to work with Achaea, so I haven't looked at the main program much (Achaea being much closer to Imperian than Lusternia). I think it's probably best, at least for the main program, to just use the Imperian one. I don't think the main program has much specific in it, other than parsing out the ATCP, which you've already got started on.

Even for the lusternia-specific module, I think basing it on the original is probably best. I'm a fan of the "starting from scratch is almost always worse" school of thought, though.