Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » redit on
Forum Rules | Mark all | Recent Posts

redit on
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 15, 2009, 8:08 am
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

Seems redit messes up when you use redit on. I tried this on a fresh compile from a fresh download.

[30000hp 30836m 30000mv]  [1exp] redit on
Redit mode on.

<Redit #121>
Usage: zones [proto/all]

<Redit #121> who
Usage: zones [proto/all]

<Redit #121> done
Usage: zones [proto/all]

<Redit #121>


It won't leave the substate and I'm not really sure why it's calling the zones command when I hit enter.
       
Post is unread #2 May 21, 2009, 6:36 am   Last edited May 21, 2009, 6:51 am by tphegley
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

Has anyone else found this to be a problem? Can anyone confirm a fresh download and see if redit works?

**EDIT**
Ok, confirmed this on Zeno's site as well. Fresh install. When you do redit on it won't let you do any other command accept either all or proto from the zone command.
       
Post is unread #3 May 21, 2009, 8:43 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Yeah, I can confirm this as well on the AFKMUD I'm running.
       
Post is unread #4 May 21, 2009, 1:12 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 that's certainly a bizarre one. Wonder how that happened.
       
Post is unread #5 May 21, 2009, 2:27 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Ok, figured it out. REALLY stupid ass bug, but we're going to try and swing a shot at Terminator Salvation before the crowds show up so I'll post the fix later.
       
Post is unread #6 May 21, 2009, 2:54 pm
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

Aw, leave us in suspense. heh.
       
Post is unread #7 May 21, 2009, 9: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

commands.cpp, interpret:

         /*
          * yes... we lose out on the hashing speediness here...
          * but the only REPEATCMDS are wizcommands (currently)
          */
         for( char x = 0; x < 126; ++x )
         {
            const vector < cmd_type * >&cmd_list = command_table[x];
            vector < cmd_type * >::const_iterator icmd;

            for( icmd = cmd_list.begin(  ); icmd != cmd_list.end(  ); ++icmd )
            {
               cmd = *icmd;

               if( cmd->do_fun != fun )
                  continue;
               found = true;
               break;
            }
         }


Change to:
         /*
          * yes... we lose out on the hashing speediness here...
          * but the only REPEATCMDS are wizcommands (currently)
          */
         for( char x = 0; x < 126; ++x )
         {
            const vector < cmd_type * >&cmd_list = command_table[x];
            vector < cmd_type * >::const_iterator icmd;

            for( icmd = cmd_list.begin(  ); icmd != cmd_list.end(  ); ++icmd )
            {
               cmd = *icmd;

               if( cmd->do_fun != fun )
                  continue;
               found = true;
               break;
            }
            if( found )
               break;
         }


That extra if(found) at the bottom is the kicker. It wasn't properly exiting the loop and I don't even know how that mistake got made. Once fixed everything worked fine.
       
Post is unread #8 May 22, 2009, 4:25 am
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

So, for those of us who are C++ impaired.. what's this part mean in plain ol' C?
            const vector < cmd_type * >&cmd_list = command_table[x];
            vector < cmd_type * >::const_iterator icmd;
       
Post is unread #9 May 22, 2009, 6:17 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

That is declaring cmd_list as a reference to the vector of cmd_type pointers stored at command_table[x], and then declaring icmd as an iterator over vectors of cmd_type pointers. The following lines of code are the actual iteration.
       
Post is unread #10 May 22, 2009, 9:23 am
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Um, yeah, that's just what it looked like... maybe C doesn't have vectors or cmd_type pointers? :shrug:
       
Post is unread #11 May 22, 2009, 10:14 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

I'm not sure what question you're asking? C definitely doesn't have C++ classes like vectors because, well, C doesn't have classes. :wink:
       
Post is unread #12 May 22, 2009, 2:22 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

cmd_type is just the standard Smaug command pointers, nothing fancy there. And no, C doesn't have vectors :)

Doesn't matter in the end since AFKMud isn't C based anymore.
       
Post is unread #13 May 22, 2009, 2:36 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

DavidHaley said:

I'm not sure what question you're asking? C definitely doesn't have C++ classes like vectors because, well, C doesn't have classes. :wink:

Basically I was just trying to understand the piece of code in front of me and, since I'm entirely unfamiliar with C++ still, I didn't recognize the cmd_type things nor the vectors so I thought I'd ask for clarification on what they were.

Samson said:

cmd_type is just the standard Smaug command pointers, nothing fancy there. And no, C doesn't have vectors :)

Doesn't matter in the end since AFKMud isn't C based anymore.

Ah, so just expressing it in C++'s format. Understood.
This whole class thing is still a mystery to me and probably will remain so until I get around to actually trying to learn C++. To me the term vector implies a direction rather than a code term. *shrug*

Fair enough, in this case my question really didn't even directly pertain to the actual fix either.
       
Post is unread #14 May 22, 2009, 2:44 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

A vector is a sequence of elements. In this case, it's a vector of pointers to cmd_type structures.

A vector in math (which is what you're thinking of) is a sequence of axis coordinates. A 2d vector is often meant to mean a direction in two-dimensional space, and likewise a 3d vector is often meant to mean a direction in three-dimensional space. But that's not necessarily the case; 2d and 3d vectors are really just 2- and 3-element lists, respectively.
       
Post is unread #15 May 22, 2009, 3:08 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

It might be simplest to think of a vector as a C array with variable size. It can be expanded on the fly during runtime by simply adding more things to it.
       
Post is unread #16 May 22, 2009, 3:11 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Yes, that's probably simpler. :wink: It's also an array that knows how big it is, contrary to C arrays which are basically just pointers into space somewhere (requiring you to track the size separately).

In brief, vectors are a godsend... in fact, all of the STL containers make life a lot more sane since you don't have to futz around with stupid things like growing arrays, managing linked lists, etc.
       
Post is unread #17 May 22, 2009, 3:34 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Sounds pretty cool, I guess once this move and such are finally done with, I really do need to start looking into leaning about C++ and trying to make my code compile under G++ like SmaugFUSS currently does. I'd been hearing (mostly from y'all) how cool STL stuff was but I guess I didn't understand that it'd mean I could be done with things like sizeof()...
       
Pages:<< prev 1 next >>