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, Sogou, Bing, Yahoo!

Members: 0
Guests: 4
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 » General » General Discussions » Smaug check_parse_name functi...
Forum Rules | Mark all | Recent Posts

Smaug check_parse_name function
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Nov 3, 2007, 11:03 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Does anyone know what a "IllIll twit" is and why it's supposed to be blocked out?

   /*
    * Alphanumerics only.
    * Lock out IllIll twits.
    */
   {
      char *pc;
      bool fIll;

      fIll = true;
      for( pc = name; *pc != '\0'; ++pc )
      {
         if( !isalpha( *pc ) )
            return false;
         if( LOWER( *pc ) != 'i' && LOWER( *pc ) != 'l' )
            fIll = false;
      }

      if( fIll )
         return false;
   }
       
Post is unread #2 Nov 3, 2007, 12:23 pm
Go to the top of the page
Go to the bottom of the page

Gatz
Apprentice
GroupMembers
Posts60
JoinedJul 25, 2005

Having see some people who like to stir up trouble and let you know who they are, it probably was just a group of players who were making names like "Illill" and "Illillillill". I find it hard, in some of these functions, to see which code is older than others. It sort of looks like the coder that added it in saw the Alpha-check and figured he could tag that in there, possibly before any ban code or anything was written.

We need some SMAUG historians around.
       
Post is unread #3 Nov 3, 2007, 12:23 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I think that's actually supposed to stop people randomly capitalizing letters in their name.

So you couldn't have someone log in with a name like ToMaS or something.
       
Post is unread #4 Nov 3, 2007, 1:04 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well given either scenario I guess I can take it out of AFKMud then since we already force names to capitalize properly, and lowercase the rest of the letters.
       
Post is unread #5 Nov 3, 2007, 1:43 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Kayle: No... The code checks specifically for L and i.

Anyway, my guess is that because l and I look so similar, they locked it out.
       
Post is unread #6 Nov 3, 2007, 1:52 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

I've also been running into instances of the use of act() that indicate they may have been programmed in before the existence of ch_printf() as well.

Things like:
act( AT_PLAIN, "You are not carrying any $T.", ch, NULL, chk, TO_CHAR );


that are better done as:
ch_printf( "You are not carrying any %s.\r\n", chk );
       
Post is unread #7 Nov 3, 2007, 6:16 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Samson said:

Does anyone know what a "IllIll twit" is and why it's supposed to be blocked out?

It's been years, but I seem to recall that there was a fad among the kids back then who would've been "emo" by today's standards that were creating characters named stuff like illill and generally they tended to be griefers and such.. my memory could be faulty on this though, it has been quite a few years. :sad:

Samson said:

I've also been running into instances of the use of act() that indicate they may have been programmed in before the existence of ch_printf() as well.

They probably were, Smaug's been around for quite awhile now, and I don't think Thoric created it without a (brief?) alpha/beta stage.
       
Post is unread #8 Nov 3, 2007, 6:30 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Conner said:

They probably were, Smaug's been around for quite awhile now, and I don't think Thoric created it without a (brief?) alpha/beta stage.

And even if they weren't, with such a large piece of software with so many people working on it, and with no guiding code policies or clear APIs, chances are that some people simply never noticed that some functions existed. Or, when they found out later, they never bothered to go back and fix things.
       
Post is unread #9 Nov 3, 2007, 7:11 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

DavidHaley said:

Conner said:

They probably were, Smaug's been around for quite awhile now, and I don't think Thoric created it without a (brief?) alpha/beta stage.

And even if they weren't, with such a large piece of software with so many people working on it, and with no guiding code policies or clear APIs, chances are that some people simply never noticed that some functions existed. Or, when they found out later, they never bothered to go back and fix things.

Excellant point, David. Smaug itself, at Realms of Despair, was a huge project that involved quite a few coders over the years and we can see from the stock code that sometimes the only real communication between those coders were tiny conversations held via code comments, it's entirely plausible that ch_printf() did exist and just didn't get communicated to the other coders well and no one bothered to try to catch all the places that it should've been used.
       
Post is unread #10 Nov 5, 2007, 1:00 am   Last edited Nov 25, 2007, 6:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

You know, it occurs to me that it might be helpful to categorize the functions into separate .h files. If that had been done, Kayle would have been able to find the function to convert a string to lowercase more easily. Things like list utility functions, string utility functions, number utility functions, etc.
       
Post is unread #11 Nov 5, 2007, 8:31 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I'll second that notion.

But I'm sure as hell not volunteering for another project for a while. >.> The last one took 9 and a half months. <.<
       
Post is unread #12 Nov 5, 2007, 1:06 pm   Last edited Nov 25, 2007, 6:53 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

DavidHaley said:

You know, it occurs to me that it might be helpful to categorize the functions into separate .h files. If that had been done, Kayle would have been able to find the function to convert a string to lowercase more easily. Things like list utility functions, string utility functions, number utility functions, etc.


I'm all for it. If anyone has any suggested organizational layouts I'm all ears. I don't always come up with the best classifications for things. For the most part though, Smaug is already pretty well organized. It's just the monolithic mud.h file that seems to cause the most grief, followed closely by the string handling functions all being scattered around.
       
Post is unread #13 Nov 5, 2007, 2:03 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

It should be pretty easy to do. I'll take a look at it one of these days. And yes, mud.h is the main culprit...
       
Post is unread #14 Nov 5, 2007, 9:42 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Again, Not volunteering again. :) Not spending another 9 months sorting and sifting through Smaug to get everything in single files. :) No thank you.
       
Post is unread #15 Nov 5, 2007, 10:00 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

It doesn't have to be exhaustive. A categorization of very common functions would still be helpful. It's the kind of thing that should be refactored progressively, not done in one massive fell swoop.
       
Post is unread #16 Nov 5, 2007, 10:54 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

I'm not volunteering either, but it doesn't sound like even doing it as a single massive update would be a nine month long project like the weather system was. Realistically, once you've determined what your classifications are going to be, and decided which functions belong to which classifications, it really ought to be a matter of cut/pasting each function from the old files to the new ones, then changing the Makefile to reflect the new files instead of the old ones and deleting off the old ones. *shrug*

On the other hand, I suppose I could see the debate about what classifications to use and which functions belong to which classifications becoming a bit extended and possibly even mildly heated on some points...
       
Post is unread #17 Nov 5, 2007, 10:57 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Well, I still think that even an approximate classification would be better than the giant heap of functions we have now. And yes, it's definitely not a nine-month project.
       
Post is unread #18 Nov 6, 2007, 7:03 am   Last edited Nov 6, 2007, 7:05 am by Caius
Go to the top of the page
Go to the bottom of the page

Caius
Magician
GroupMembers
Posts132
JoinedJan 29, 2006

Personally I've started isolating all code that isn't dependent on application specific classes/structs (like CHAR_DATA, OBJ_DATA, etc), put them in a separate directory, compile as a static or shared library and link it in with the mud code. For example I've put functions like capitalize, str_cmp, str_prefix, etc in a directory called <main dir>/src/lib/utils/ along with the following Makefile:

PREFIX = ../../..
OBJS = utils.o
CXX = g++
CXXFLAGS = -Wall -O2 -MD -ansi
LIBNAME = libmudutils.a

all:            $(LIBNAME)

$(LIBNAME):     $(OBJS)
                ar cru $@ $(OBJS)
                ranlib $@

clean:
                @rm -f *.a *.d *~ core* $(OBJS)

-include *.d

install:        all
                cp $(LIBNAME) $(PREFIX)/lib
                cp *.hpp $(PREFIX)/include
                @make clean

So I type 'make install' which will compile a static library called mudutils.a and copy it, along with the header file(s) into <main dir>/lib/ and <main dir>/include/ respectively. In the main Makefile I then link in -lmudutils and make sure the linker finds the library by adding -I../include (that's a capital i, not a lowercase L) and -L../lib to compiling and linking stage as appropriate.

I think this approach has some advantages. 1) You don't have to recompile the library unless you do changes to it. 2) You don't get tempted as easily to play around with (recode just "because";) basic functions that works well as they are. 3) It encourages you to write code that isn't dependant on other classes/structs, and can therefore be used in other projects as well.

Changing the Makefile to create a shared library instead isn't too hard either, if you prefer that (ie, you won't need to recompile the mud after changing the library).
       
Pages:<< prev 1 next >>