making game portless/internetless

Posted by Swimming on Thu 05 Feb 2004 01:09 AM — 20 posts, 68,393 views.

#0
halloo.
I'm trying to make smaug so it can run on my computer without having to telnet or connect to it. i've gotten ridden of all the references to port stuffs and now it actually starts up, it hadn't been before because it could never resolve a port,(that's why i'm doing this).
now i just need to find a way to make it so i can play somehow...
do i need to try and make a special kinda command deal to handle and show the text or is there something like that i can butcher out there somewhere?
or have i not been too clear?

thankee~~
USA #1
You can just "telnet" to localhost. Generally, if you're trying to play single player, you launch the server and then just connect to localhost.

If you want to completely remove all "networktivity", you'll want to use standard input instead of the sockets; however, that's a pretty big project and it's not quite as simple as just stripping out the network stuff. It's a pretty big project. I'd advise to just connect to localhost.
#2
i cannot connect by localhost, telnet or anything. it does not work at all on my computer, and i can't get it fixed, that's why i'm doing this.
so what should i do?

thankee~~
USA #3
How can you not connect to localhost? If the port opens, you can always connect to localhost, assuming you have winsock and stuff installed.

What kind of setup do you have?
Australia Forum Administrator #4
Are you using a different computer to the one you are using to post messages here?

If you have Unix you almost certainly could connect to localhost, if you have Windows it is usually installed too. If not, install TCP/IP protocol. That would be a lot easier than hacking the code away to talk to a single player.
#5
yes i'm posting on a different computer.
my computer runs windows98. it has all the winsock, tcp/ip stuff installed, but none of it works.
when i try to startup the server with the ports it doesn't detect them and it doesn't start. nothing i use for ports works.

. . .
USA #6
What do you mean by the server doesn't detect the ports? And what doesn't start, the server?

Chances are it's not at all a networking issue, but something else entirely... where did you get your version of SMAUG?
Canada #7
If you could post some of the errors that your getting, it would make a big difference in trying to help you.
#8
Okay.
i try to startup the server but i get this:
"Address family not supported by protocol family"(fairly certain this is what it says)
and it doesn't start. this is the only error i get.

have reinstalled winsock, tcp/ip ...
have yet to reinstall windows, but i can't(don't have disk)

downloaded smaug from the smaug website

i have other programs that have server stuffs and they don't work either, they just tell me they can't startup the server. and i have other muds that say the same thing smaug does that don't work either.

i am still interested in making smaug just talk to one person though. because i have plans, and i don't think my computer has a hope in the world of being saved...

~~swimming~~
Australia Forum Administrator #9
Doing a search on your error message reveals some suggestions:

Make sure you...

  1. have "Client for Microsoft Networks"
  2. install the Microsoft version of "TCP/IP"
  3. you're logged in and have a current IP address. You can use "winipcfg" from the Start\Run command.
  4. test other network applications for proper operability


Another site suggests "The problem is that the winsock.dll file in the Windows directory is the wrong version and needs to be replaced. ".

Also there is a suggestion that Trumpet Winsock (some versions) may cause this. Are you using that?


#10
i have client for windows, tcp/ip (i have reinstalled them several times), i have also replaced winsock, all and part, several times, with different versions and all that goodness

and all other network applications don't work either.

i've given up trying to fix it that way, so i just want to make smaug to talk to me, just point me to how

~~
USA #11
Do you have a precompiled SMAUG executable or do you have the actual source code? If you have source, do you have the area files to go with it? Also for source, what compiler are you using? What is your startup command (and the exact resulting error messages) regardless of version? What is the ip address of your computer?

Just telling us it doesn't work without giving us any real info doesn't give us much chance of helping you solve your problem.
Amended on Tue 10 Feb 2004 06:03 AM by Meerclar
Canada #12
Also, making a mud for single use might not be so much fun, however, if your not aware, descriptor 0 is stdin, you might be able to us that, open a connection to descriptor 0, but I can't guarantee anything.
#13
Do you have a precompiled SMAUG executable or do you have the actual source code? If you have source, do you have the area files to go with it? Also for source, what compiler are you using? What is your startup command (and the exact resulting error messages) regardless of version? What is the ip address of your computer?

i have both the precompiled and source, all the files they need. They've both worked before but for no reason at all it's started this trouble.
cygwin for compiling, ../src/smaug.exe

the error message is 'socket family not supported by protocol'

meh~~
USA #14
When you say they worked before, do you mean that they worked with connections and all that?

If so, then you'd be better off trying to find out why they don't work anymore. Things don't just randomly stop working like that; chances are you changed network settings somewhere and broke it.

Can you show exactly where that error message is appearing?
#15
>When you say they worked before, do you mean that they >worked with connections and all that?

yep, everything worked before.

>If so, then you'd be better off trying to find out why >they don't work anymore. Things don't just randomly stop >working like that; chances are you changed network >settings somewhere and broke it.

I didn't change any settings or install anything. i just went to sleep one night with it working fine, and next day it was kaput.
would a program change stuff for no reason at all overnight?
i doubt it...

The error message appears after 'initializing sockets'

thankee~~
USA #16
So you get the error when you run the server, not when you compile? Is this output from SMAUG? Can you paste the text up until that point? What about the source code that outputs that error? We can't help you unless you're more specific and give more information.


And no, things don't just break overnight for no reason. Not even on Windows.

Chances are that there is something much more broken, and removing all network code - an extremely daunting task in and of itself - may not fix your problem.
#17
nothings wrong with it when it compiles. It's something wrong with my computer not the code.

here's the output anyway:
...
Fri Feb 13 16:59:34 2004 :: Loading councils
Fri Feb 13 16:59:34 2004 :: Loading deities...
Fri Feb 13 16:59:34 2004 :: $
Fri Feb 13 16:59:34 2004 :: Done deities
Fri Feb 13 16:59:34 2004 :: Loading deities
Fri Feb 13 16:59:34 2004 :: Loading councils...
Fri Feb 13 16:59:34 2004 :: $
Fri Feb 13 16:59:34 2004 :: Done councils
Fri Feb 13 16:59:34 2004 :: Loading watches
Fri Feb 13 16:59:34 2004 :: Loading bans
Fri Feb 13 16:59:34 2004 :: Done.
Fri Feb 13 16:59:34 2004 :: Loading reserved names
Fri Feb 13 16:59:34 2004 :: Loading corpses
Fri Feb 13 16:59:34 2004 :: Loading Immortal Hosts
Fri Feb 13 16:59:34 2004 :: Done.
Fri Feb 13 16:59:34 2004 :: Loading Projects
Fri Feb 13 16:59:34 2004 :: Loading Morphs
Fri Feb 13 16:59:34 2004 :: Optimizing Morphs.
Fri Feb 13 16:59:34 2004 :: Done.
Fri Feb 13 16:59:34 2004 :: Loading Colors
Fri Feb 13 16:59:34 2004 :: Initializing socket
Init_socket: socket: Address family not supported by protocol


and it does the same on freshly downloaded source code

and here's where the error come from:
int init_socket( int port )
{
char hostname[64];
struct sockaddr_in sa;
int x = 1;
int fd;
gethostname(hostname, sizeof(hostname));
if ( ( fd = socket( AF_INET, SOCK_STREAM, 0 ) ) < 0 )
{
perror( "Init_socket: socket" );
exit( 1 );
}
if ( setsockopt( fd, SOL_SOCKET, SO_REUSEADDR,
(void *) &x, sizeof(x) ) < 0 )
{
perror( "Init_socket: SO_REUSEADDR" );
closesocket( fd );
exit( 1 );
}
#if defined(SO_DONTLINGER) && !defined(SYSV)
{
struct linger ld;
ld.l_onoff = 1;
ld.l_linger = 1000;
if ( setsockopt( fd, SOL_SOCKET, SO_DONTLINGER,
(void *) &ld, sizeof(ld) ) < 0 )
{
perror( "Init_socket: SO_DONTLINGER" );
closesocket( fd );
exit( 1 );
}
}
#endif
memset(&sa, '\0', sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = htons( port );
if ( bind( fd, (struct sockaddr *) &sa, sizeof(sa) ) == -1 )
{
perror( "Init_socket: bind" );
closesocket( fd );
exit( 1 );
}
if ( listen( fd, 50 ) < 0 )
{
perror( "Init_socket: listen" );
closesocket( fd );
exit( 1 );
}
return fd;
}

...

and i've removed all network code and it actually starts up and runs. I know it runs because it's showing the reset messages, only now i can't log in, of course.

i'm going to reinstall it with windows 95 cus that's the disk i have, i hope nothing on my computer needed 98 . . .
<sigh>

~~thankee for the help~~
Australia Forum Administrator #18
You could always install Linux. Recent versions have an installer that is as easy to use as the Windows installer, and the MUD will be a lot more reliable.
#19
darnit. i don't have the windows code...
linux, humm? why not?

~~thankee~~