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.
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.
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:
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.
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
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.
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.
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.