|
|
David Haley
Wizard


Group: Members
Posts: 5,728
Joined: Jun 30, 2007
|
#137 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...
|
|
|
quixadhal
Wizard


Group: Members
Posts: 1,256
Joined: Oct 17, 2007
|
#138 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.
|
......................... 
|
|
Vassi
Conjurer


Group: Members
Posts: 182
Joined: Sep 24, 2008
|
#139 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,074
Joined: Jun 1, 2006
|
#140 Posted Oct 31, 2008, 3:42 am
|
Telnet
Yakk Deculture.
|
|
......................... -Heath
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,256
Joined: Oct 17, 2007
|
#141 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....
|
......................... 
Last edited Oct 31, 2008, 11:25 pm by quixadhal
|
|
|
|
Runter
Wizard


Group: Members
Posts: 1,074
Joined: Jun 1, 2006
|
#143 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.
|
|
......................... -Heath
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,074
Joined: Jun 1, 2006
|
#144 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.
|
|
......................... -Heath
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,074
Joined: Jun 1, 2006
|
#147 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. ;)
|
|
......................... -Heath
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,074
Joined: Jun 1, 2006
|
#148 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.
|
|
......................... -Heath
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,074
Joined: Jun 1, 2006
|
#150 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.
|
|
......................... -Heath
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
|
|