[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  Tiny MUD server - example code

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Tiny MUD server - example code
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2 

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Wed 25 Jul 2012 12:15 PM (UTC)  quote  ]
Message
This line breaking is something you added, right? So you need to look at how you did it. Most modern clients do word wrapping anyway, so I wouldn't bother trying to wrap at the server end.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Daniel Spain   (15 posts)  [Biography] bio
Date Wed 25 Jul 2012 05:02 AM (UTC)  quote  ]
Message
Nick Gammon said:

What client are you using?


after i compile i use the windows telnet client to connect to test but typically i connect using qmodem pro.
[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Wed 25 Jul 2012 03:09 AM (UTC)  quote  ]
Message
What client are you using?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Daniel Spain   (15 posts)  [Biography] bio
Date Tue 24 Jul 2012 11:00 AM (UTC)  quote  ]
Message
hey Nick i used your tinymud source as a starter for my mud in c++.

i wrote a workaround to add color to message text but could you point me into a good direction to format the text so it dont breakup? if a word is too long when it hits the edge of the screen instead of taking the whole word to the next line it only takes the rest of the word ... example:


Ice is a stunningly attractive and powerfully built male gobl
in blackguard with a worldly air about him. He has a tan comp
lexion, red eyes, and black, wild, short hair. You notice that
his movements are very quick and agile. He has a bright look i
n his eyes. He is wearing elven chainmail armor, is armed with
a darksword and he appears to be wounded. You also notice a di
stinctive violet rune inscribed on his forehead.

in that block of text when looking at my player it split up the words goblin, complexion, in, and distinctive.

i as thinking maybe capture the block of text and catch where its gonna break, i dunno, its not a big deal just something i want to work on.
[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Sun 03 Apr 2011 09:13 PM (UTC)  quote  ]
Message
I was forced to change to http downloads rather than ftp ones a while ago. This link works:


http://www.gammon.com.au/files/muds/tinymudserver_dev_cpp-1.0.0.zip

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nico   (1 post)  [Biography] bio
Date Sun 03 Apr 2011 05:35 PM (UTC)  quote  ]
Message
Hello Nick,

The link asks for a password..?

ftp://ftp.gammon.com.au/muds/tinymudserver_dev_cpp-1.0.0.zip

[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Wed 07 Jul 2004 01:48 AM (UTC)  quote  ]

Amended on Sun 03 Apr 2011 09:14 PM (UTC) by Nick Gammon

Message
It is always nice if you say what the errors are rather than such a general report, however I tried to compile it under Dev CPP and see what you mean.

Basically the example server I posted was designed to be compiled under Linux or Cygwin. Microsoft, for reasons best known to themselves, have modified the network code somewhat and changed the names of things. For instance "read" on Linux becomes "recv" on Windows, and "write" on Linux becomes "send" on Windows. Plus, various header file changes and so on. You also need network initialisation code, and shutdown code. It isn't that bad, but can be confusing if you haven't seen it before.

I have done a variant which compiles and runs under Dev-C++ version 4.9.8.0. This can be downloaded from:

http://www.gammon.com.au/files/muds/tinymudserver_dev_cpp-1.0.0.zip

(9 Kb file).

The changes basically have "#if defined(WIN32) ... #endif" around them.

[EDIT] Changed from ftp link to http link. 4 April 2011.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rechocto   (6 posts)  [Biography] bio
Date Wed 07 Jul 2004 12:51 AM (UTC)  quote  ]
Message
neither Dev cpp, or (payed for) Borland C++ Builder Pro,
seem to be able to compile it.
[Go to top] top

Posted by Ready   (15 posts)  [Biography] bio
Date Wed 16 Jun 2004 02:21 PM (UTC)  quote  ]
Message
I had already tried that but I got it working in the end, thanks for your help
[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Mon 14 Jun 2004 09:46 PM (UTC)  quote  ]

Amended on Mon 14 Jun 2004 09:49 PM (UTC) by Nick Gammon

Message
Did you look at the source code? If you edit tinymudserver.cpp and go to line 66 you see this:


/* NB - if you get errors on the "accept" line remove the typedef below */
typedef int socklen_t;  // line 66


NB means "very important".

If you are planning to write a MUD server, or even change one, you need to get used to compiling code, reading C++ and generally helping yourself.

Error messages like this:


tinymudserver.cpp:66: error: redeclaration of C++ built-in type `int'


refer to line numbers in the code. In this case, line 66. The first thing you would do is open the code (the filename is given in the message, tinymudserver.cpp) and go to the line. Then see if something is obviously wrong. In this case the author (me) has put in a comment to help you.

The reason for this is some compilers have socklen_t predefined, some don't. Thus the requirement to comment or un-comment that line depending on whether you get an error or not.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Ready   (15 posts)  [Biography] bio
Date Mon 14 Jun 2004 03:25 PM (UTC)  quote  ]
Message
Right I've mahanged to extract it now, i wanted to compile it to just check how it works at the moment (to get the feel of it ;)
At the moment it wont let me compile because of:
g++ -g -Wall -c tinymudserver.cpp
tinymudserver.cpp:66: error: redeclaration of C++ built-in type `int'
make: *** [tinymudserver.o] Error 1

is it cos i have to add something first or what?
[Go to top] top

Posted by Nick Gammon   Australia  (18,797 posts)  [Biography] bio   Forum Administrator
Date Sun 13 Jun 2004 05:11 AM (UTC)  quote  ]
Message
I just tried downloading it and it worked perfectly (with WinZip).

In any case, if you are going to compile it, which you need to, and you are using Cygwin, then you can un-tar it like this:

tar xvzf tinymudserver-1.0.0.tar.gz

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Ready   (15 posts)  [Biography] bio
Date Sat 12 Jun 2004 06:42 PM (UTC)  quote  ]
Message
None of that works.

What happens is that the file extracts but when it extracts the folder tinymud it put out a Okb file with the name of the folder.
From then on the tar code extracted from the gzip will not extract any of the files or the folder and says there is an error opening the files.

what do i do?
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Sat 12 Jun 2004 05:34 AM (UTC)  quote  ]
Message
When downloading and choosing where it saves to, in the box do this:

"blah.tar.gz"

instead of

blah.tar.gz

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Timbo   (1 post)  [Biography] bio
Date Fri 11 Jun 2004 10:40 PM (UTC)  quote  ]
Message
The problem I usually have is that .tar.gz files get saved with a different file name (and changes what's right before the last dot) when opening them from the location. This is okay with blah.zip because it becomes something like c:\temp\blah[1].zip, but with blah.tar.gz, it becomes c:\temp\blah.tar[1].gz, and that's a problem because WinZip and other programs use the filename before the .gz to determine what is in the .gz file, and ".tar[1]" doesn't make sense to it. .tgz files are okay to open from location, but need to save .tar.gz files to disk if you want WinZip to open it nicely.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


8,868 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]