MudBytes
» MUDBytes Community » Codebase Specific » DikuMUD » Rom » RaM » Proposed bug fixes
Pages: << prev ... 8, 9, 10, 11, 12 ... next >>
Proposed bug fixes, stuff to fix stock ROM
quixadhal
Wizard






Group: Members
Posts: 1,472
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#136 id:14413 Posted Oct 26, 2008, 5:57 pm

So, you've had problems logging into a real telnet server using a telnet client?  I've never had any issues doing so.  I've found tinyfugue and tintin both worked fine unless you tried to run full-screen apps (neither client would do the negotiation that would allow single-character mode or curses support).

How can doing things the right way be MORE dangerous than doing it the wrong way?
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

David Haley
Wizard






Group: Members
Posts: 6,874
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#137 id:14415 Posted Oct 26, 2008, 6:06 pm

quixadhal said:
So, you've had problems logging into a real telnet server using a telnet client?

I'm not sure what you're referring to here.

Well, this is a whole lot of tempest in a pretty small teapot. I agree that there are far more important things to be worrying about...
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

quixadhal
Wizard






Group: Members
Posts: 1,472
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#138 id:14416 Posted Oct 26, 2008, 6:15 pm

/agreed that it's too small to worry about. :)

I meant a real, honest-to-goodness telnet server... IE: telnetd, probably not running on port 23.  On most systems nowadays, you'd have to go enable it, but that USED to be the way you connected to other machines, before ssh existed, and before rsh was popular.  THAT is the only reason MUD's used telnet back in the day, because everybody had a telnet client.

Heck, if we really had extra time, I'd say let's implement the server side of ssh on another port.  That way, you could allow players to use it if they wanted, but require it for immortals.
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

Vassi
Conjurer






Group: Members
Posts: 182
Joined: Sep 24, 2008

Go to the bottom of the page Go to the top of the page
#139 id:14420 Posted Oct 26, 2008, 10:14 pm


quixadhal said:
/agreed that it's too small to worry about. :)

I meant a real, honest-to-goodness telnet server... IE: telnetd, probably not running on port 23.  On most systems nowadays, you'd have to go enable it, but that USED to be the way you connected to other machines, before ssh existed, and before rsh was popular.  THAT is the only reason MUD's used telnet back in the day, because everybody had a telnet client.

Heck, if we really had extra time, I'd say let's implement the server side of ssh on another port.  That way, you could allow players to use it if they wanted, but require it for immortals.


It seems to me the only way to 'sneak in' a new client model is to make a working Telnet client that also just happens to support this new protocol (whatever it is), and make sure said client is available on multiple platforms.

Of course, some would be quick to point out what happened with MXP, or that it's already happened with Aardwolf\MUSHClient, but that is a whole different case - I think. I wish Nick and Lasher had taken things a notch higher with the Aardwolf integration, I really feel it would have made a bigger difference. In both cases they were\are trying to ride Telnet - which is arguably not a bad idea, subnegotiation (if you rigged it to work both ways) is pretty awesome. The problem of course comes back to how most existing implementations are just good enough to get by (most often by just ignoring everything except a few select things).

Anyway, I feel I shot myself in the foot somewhere in there but I'm not sure where. It's been a long day.
.........................
Vassi no Diem et Tharin
<ramble/>

Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#140 id:14549 Posted Oct 31, 2008, 3:42 am

Telnet

Yakk Deculture.
.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

quixadhal
Wizard






Group: Members
Posts: 1,472
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#141 id:14573 Posted Oct 31, 2008, 11:25 pm

Ummmmm..... W. T. F. ????

Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
char                   *fread_string_eol( FILE * fp )
{
    static bool             char_special[256 - EOF];
    char                   *plast = NULL;
    char                    c = '\0';
 
    if ( char_special[EOF - EOF] != true )
    {   
        char_special[EOF - EOF] = true;
        char_special['\n' - EOF] = true;
        char_special['\r' - EOF] = true;
    }


Unless I'm very much mistaken, EOF is typically defined in the system header files as -1.... so this code is really declaring an array that's 257 bytes long, and then looking at an UNINITIALIZED array, making a decision based on element 0 of it?

Is that really what's happening here?

I don't think I've had enough to drink to be sure....
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

Last edited Oct 31, 2008, 11:25 pm by quixadhal
David Haley
Wizard






Group: Members
Posts: 6,874
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#142 id:14574 Posted Oct 31, 2008, 11:40 pm

That function is just wrong on so many levels.  :cry:

I have no idea what the intention was there.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#143 id:14584 Posted Nov 1, 2008, 3:26 am


I can answer part of that. That array is initialized. 

Static and global variables can be safely assumed as memory set to 0 on the binary level. All elements in such a class, or elements of such an array would indeed be 0.

However, the code looks bad anyways. I'm not sure what the intent is without he rest of the function.  Using variables inside of array declarations is also a gcc extension that allows it to work.
.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#144 id:14585 Posted Nov 1, 2008, 3:50 am

I don't know what all of the EOF math uses are for but the array in general seems legitimate after reviewing the full context. 
.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

quixadhal
Wizard






Group: Members
Posts: 1,472
Joined: Oct 17, 2007

Go to the bottom of the page Go to the top of the page
#145 id:14594 Posted Nov 1, 2008, 10:35 am

It always seemed odd to me that the Diku people go to such herculean efforts to avoid using sscanf() or fscanf() for things.  I mean, there are far simpler ways to parse and load a file format, even if you don't do it the lazy way of reading the whole file and then passing over it in RAM until you get everything you want out of it.

If I'm to believe the function name, all this does is read a string using EOL as the terminator instead of the old ~ character.  Why it can't just use fgets() and then do whatever mojo the shared string junk requires is beyond me.

Oh well, I'll investigate that sometime before the meeting Sunday.  I'm almost done with my one last cleanup for the code in general, and then we can see what bugs on Ye Olde Bugee Listee (now with more e's!) people want to tackle.  Time to head out to lunch before the bank closes though (assuming it's even open today).
.........................
http://i302.photobucket.com/albums/nn96/quixadhal/DramaBytes.png

David Haley
Wizard






Group: Members
Posts: 6,874
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#146 id:14597 Posted Nov 1, 2008, 12:22 pm

I don't think it's a gcc extension to allow array definitions to use constant-folded math. E.g., int i[5 + 6]. If EOF is a macro then it would be constant-folded. It is an extension to have things like int i[x] though. It's been a while since I looked at this in detail so maybe I'm misremembering.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#147 id:14603 Posted Nov 1, 2008, 6:44 pm

Heh. I thought this was kinda cute. fread_string() and fread_to_eol() are similar but implemented differently in rom.

This is out of fread_string() at the point where it uses that silly array in the other function to check for breakable characters.

Quote:

        /*
        * Back off the char type lookup,
        *  it was too dirty for portability.
        *  -- Furey
        */


Guess it was good enough for portability to leave it in the next function in the file. ;)

.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

Last edited Nov 1, 2008, 6:45 pm by Runter
Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#148 id:14604 Posted Nov 1, 2008, 6:48 pm


quixadhal said:
It always seemed odd to me that the Diku people go to such herculean efforts to avoid using sscanf() or fscanf() for things.  I mean, there are far simpler ways to parse and load a file format, even if you don't do it the lazy way of reading the whole file and then passing over it in RAM until you get everything you want out of it.

If I'm to believe the function name, all this does is read a string using EOL as the terminator instead of the old ~ character.  Why it can't just use fgets() and then do whatever mojo the shared string junk requires is beyond me.

Oh well, I'll investigate that sometime before the meeting Sunday.  I'm almost done with my one last cleanup for the code in general, and then we can see what bugs on Ye Olde Bugee Listee (now with more e's!) people want to tackle.  Time to head out to lunch before the bank closes though (assuming it's even open today).


They probably wanted to do it without needing to edit the string they got from fgets() considering the function already takes most of the boot up time. They likely didn't want to go through every string and search and remove ~ from every single string after it was already read. Considering that fgets() probably does just about the same thing as their function without checking for the special characters, it probably was more efficient their way in a noticeable way.
.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

David Haley
Wizard






Group: Members
Posts: 6,874
Joined: Jun 30, 2007

Go to the bottom of the page Go to the top of the page
#149 id:14605 Posted Nov 1, 2008, 7:03 pm

Removing ~ from the end of strings would be extremely cheap if you did it right (start searching from the end...). Add that to the fact that library routines are typically very optimized, sometimes even on the assembly level, I would be a little surprised if they were actually increasing performance. Perhaps I am simply less charitable than you but sometimes I think that somebody just made a mistake and everybody else decided to live with it rather than spend the time to fix it, because "it would be so much effort" and all that jazz.
.........................
-- d.c.h --
BabbleMUD Project (custom codebase)
Legends of the Darkstone (head coder)
http://david.the-haleys.org
.........................

Runter
Wizard






Group: Members
Posts: 1,850
Joined: Jun 1, 2006

Go to the bottom of the page Go to the top of the page
#150 id:14609 Posted Nov 1, 2008, 8:44 pm

That's not true.  You can't assume ~ or any other special character is at the end. It would take parsing the entire string twice. Once to read and once to check the elements. When you could have just done it at the same time. 
.........................
CoralMud project

For once you have tasted flight Ruby you will walk the earth with your eyes turned skywards,
for there you have been and there you will long to return. --
                                              Leonardo Da Vinci Yukihiro Matsumoto

Pages:<< prev ... 8, 9, 10, 11, 12 ... next >>
Tags
[+]

Valid XHTML 1.1! Valid CSS!