29 Apr, 2013, SteveThing wrote in the 1st comment:
Votes: 0
Hi all,

Been a long time mudder… almost 20 years now. Been out of the game for the past few years due to military duties. Now I'm back! While playing around with my brand new Raspberry Pi, I had the idea of running a MUD server on it just to see if it could handle it. Figured I'd call it "MUD Pi". Sure enough, barely 1% mem usage with a couple players on and 0.1% CPU with spikes up to 5% (probably during a mob repop).

In any event, after I fixed most of the warnings and got an almost clean compile, I began searching for bugs. I remember back in the day there used to be a bug list, but "Alas, you cannot go that way". Anyone know of a bug list I can reference? Currently using ROM 2.4b6 stock (no OLC, no colour). Biggest bug that is annoying me is a fresh boot will say "Illegal name" the first time you try to log in, even if the name is valid. Haven't investigated it yet though.

Optimizations:

I decided to start in act_comm.c:do_channels(). Here's what I got:

void do_channels( CHAR_DATA *ch, char *argument)
{
char buf[MAX_STRING_LENGTH];
BUFFER *output;

buf[0] = '\0';
output = new_buf();

// lists all channels and their status
add_buf(output," channel status\n\r———————\n\rGossip ");
add_buf(output,IS_SET(ch->comm,COMM_NOGOSSIP) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Auction ");
add_buf(output,IS_SET(ch->comm,COMM_NOAUCTION) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Music ");
add_buf(output,IS_SET(ch->comm,COMM_NOMUSIC) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Q/A ");
add_buf(output,IS_SET(ch->comm,COMM_NOQUESTION) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Quote ");
add_buf(output,IS_SET(ch->comm,COMM_NOQUOTE) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Grats ");
add_buf(output,IS_SET(ch->comm,COMM_NOGRATS) ? "OFF\n\r" : "ON\n\r");

if (IS_IMMORTAL(ch))
{
add_buf(output,"God Channel ");
add_buf(output,IS_SET(ch->comm,COMM_NOWIZ) ? "OFF\n\r" : "ON\n\r");
}

add_buf(output,"Shouts ");
add_buf(output,IS_SET(ch->comm,COMM_SHOUTSOFF) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Tells ");
add_buf(output,IS_SET(ch->comm,COMM_DEAF) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"Quiet Mode ");
add_buf(output,IS_SET(ch->comm,COMM_QUIET) ? "OFF\n\r" : "ON\n\r");
add_buf(output,"AFK Mode ");
add_buf(output,IS_SET(ch->comm,COMM_AFK) ? "OFF\n\r" : "ON\n\r");

if (IS_SET(ch->comm,COMM_SNOOP_PROOF))
add_buf(output,"You are immune to snooping.\n\r");

if (ch->lines)
{
sprintf(buf,"You display %d lines of scroll.\n\r",ch->lines+2);
add_buf(output,buf);
}
else
add_buf(output,"Scroll buffering is off.\n\r");

if (ch->prompt != NULL)
{
sprintf(buf,"Your current prompt is: %s\n\r",ch->prompt);
add_buf(output,buf);
}

add_buf(output,"Allowed to shout: ");
add_buf(output,IS_SET(ch->comm,COMM_NOSHOUT) ? "NO\n\r" : "YES\n\r");
add_buf(output,"Allowed to tell: ");
add_buf(output,IS_SET(ch->comm,COMM_NOTELL) ? "NO\n\r" : "YES\n\r");
add_buf(output,"Allowed to use channels: ");
add_buf(output,IS_SET(ch->comm,COMM_NOCHANNELS) ? "NO\n\r" : "YES\n\r");
add_buf(output,"Allowed to use emotions: ");
add_buf(output,IS_SET(ch->comm,COMM_NOEMOTE) ? "NO\n\r" : "YES\n\r");

send_to_char(buf_string(output),ch);
free_buf(output);
}


I decided to remove most sprintf() calls. The idea is to reduce the amount of formatting needed for a string. I'm well aware this is not much considering this function isn't used often. It was a practice to see if it would work before tackling other string heavy functions/loops. Does anyone see any issues with this or maybe offer some suggestions?

I cannot escape formatting entirely, but I'm trying to step away from dangerous buffer overflows/memleaks. Then again, I'm not even sure if the functions in recycle.c are bug-free.

Thanx guys!
29 Apr, 2013, Igabod wrote in the 2nd comment:
Votes: 0
look through the code repository here to find RaM which is the modern version of ROM with many additions. There is a plain C version as well as a C++ version I believe. All the work you want to do has already been done for you.

[edit to add] Here I found it for ya, check it out. RaM Directory in the repository.
29 Apr, 2013, SteveThing wrote in the 3rd comment:
Votes: 0
Thanx. I will look into this after work.

Hows the code look above?
03 May, 2013, SteveThing wrote in the 4th comment:
Votes: 0
So I've been digging into RaM:Ice. Very nice, though not commented very well. The HACKLOG is a nice touch though. I like the compile options which force you to make sure you compile cleanly. In any event, I was curious if anyone had attempted to move away from C strings to std::strings or go from structures to classes? If so, any suggestions or pitfalls to avoid?
03 May, 2013, quixadhal wrote in the 5th comment:
Votes: 0
The Fire version was intended to start that procedure, along with using iterators and std:: containers instead of hand-rolled linked lists and whatnot. We lost steam somewhere in there, and I'm not sure how far along that part of the project got.
03 May, 2013, SteveThing wrote in the 6th comment:
Votes: 0
Is that part of the codebase in the repository? If not, may I take a crack at it? I started playing MUDs on ROM and it's got a soft spot in my heart. I'd be honored to have the opportunity to make it better.
04 May, 2013, quixadhal wrote in the 7th comment:
Votes: 0
Yeah, looks like the most recent snapshot was from Mudder, in 2010.

http://www.mudbytes.net/index.php?a=file...

and specifically http://www.mudbytes.net/file-2750

Good luck! If you do anything with it, please push a copy back in there… always nice to see people still tinkering with stuff.

(We originally were using subversion to work on this. I don't know if the repository is still out there, but if you really wanted to work on it again, I'd probably push it into github or something similar.)
08 May, 2013, Mudder wrote in the 8th comment:
Votes: 0
I didn't do anything major to Fire after the rest of the team left. A bit too much of a rookie to know what I was doing. I'll probably start getting back into the MUD world again. In a couple months.
13 May, 2013, SteveThing wrote in the 9th comment:
Votes: 0
Well, if you do, hit me up. I don't know much about subversion, but I plan to once I get my head wrapped around these data structures (aka, cleaning them up). I am in the process of converting most data structures into classes and making a Binary Search Tree template to allow for faster database searches. I have a feeling I may end up re-writting most of this codebase so I think I'll end up as a whole new derivative of ROM or RaM.

I really like the changes yall made, but I'm surprised you stuck with C-style strings. Then again, doing the conversion myself it seems a bit daunting…
13 May, 2013, Tyche wrote in the 10th comment:
Votes: 0
You might want to check out Murk++, which is my C++ translation of Merc, which is the immediate ancestor of ROM.
The architecture is nearly identical.
0.0/10