|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic Page: 1 2 »» |
Last Thread Next Thread ![]() |
| MUD Pies Part I |
|
![]() dalleboy Member since: 4/14/2002 From: Umea, Sweden |
||||
|
|
||||
| Some errors: In GlobalWndProc: The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created. Thus SetWindowLong should be called for WM_NCCREATE and not for WM_CREATE. When describing inlines: Don't confuse the readers more than you have to: inline void foo(int n) { output(n); return n+5; }should be: inline int foo(int n) { output(n); return n+5; } Update GameDev.net system time campaign - success at last |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
quote: Thanks for pointing these out. First article and all, it is much appreciated. quote: hmmn, not too sure about this one. I will take your word for it. I am not a huge fan of the Win32 API, I prefer to use a libary for windowing (Borland's VCL), so the most I actualy use it is in my OpenGL programs, or (of course) servers (where the 'normal' way is a far eaiser method of accessing the message system). Suffice to say that it works in all the programs I have made, so unless it will cause a fatal error, I shall leave it that way. I will investigate it, though, for any future programing or articles. quote: Typo. Ack. There's one in every article. Either Dave will see this and correct it or I will email him as soon as I can. It has been updated in my original copy of the article. Do not meddle in the affairs of moderators, for they are subtle and quick to anger. ANDREW RUSSELL STUDIOS Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ] Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Asking Questions | Go FAQ yourself ] [edited by - Andrew Russell on April 13, 2003 10:29:52 AM] |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
| Actualy, there is a bit of false advertising in that article "He is currently developing the game mechanics and story line for an up coming MUD." This is no longer the case. That project has been transfered to someone else. Another typo: I called a "switch" statement a "select" statement (although, the code was correct) Do not meddle in the affairs of moderators, for they are subtle and quick to anger. ANDREW RUSSELL STUDIOS Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ] Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Asking Questions | Go FAQ yourself ] |
||||
|
||||
![]() Myopic Rhino Staff Member since: The dawn of time
From: Temecula, CA, United States |
||||
|
|
||||
| Andrew, I updated the errors pointed out here in the text of the article. If you could update the source and send it to me, I'd appreciate it. |
||||
|
||||
![]() Shadow Mint Member since: 5/1/2000 From: Australia |
||||
|
|
||||
| You know, I've often thought muds would be a lot better if they could escape the fact that they have to manually implement the telnet protocol. Surely a mud SHELL, using -existing resources- to allow telnet, ssh, etc. to connect, and simply devoted entirely to the database management and player processing would be much better? I mean, when you think about it, imagine a std. unix box which allows the player to login using any std. method. The player can then pick their shell (ie. which mud on the machine to use), and the system can use: - Existing server / client code - Existing database management (read, filesystem) - Existing security measures - Existing logging capabilities - Existing user-to-user communication abilities PLUS, you could implement all of the mud commands as independent applications on the OS, allowing them each to be implemented in what ever language you wanted: you just have to define the file formats they must obey... Mobs could be implemented as independent processes, allowing totally flexible and dynamic mob control at virtually no cost (all that nasty process control is already native to the os). You could even run the damn thing off a windows machine using emulation (like what's it, that normal emulation layer stuff, I forget the name)... Just a thought. Classical mud code sucks IMHO. There are SO MANY THINGS you can just avoid having to do, allowing you to focus on the real meat of the mud (content, commands), its depressing watching people trying to write muds from scratch. Of course, I realise the point of this article series is to expose the issues of networking, security, etc. to people, but indeed. Just my $0.02. |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
| OK, I have updated the sources and am bout to send, the only change was the WM_NCCREATE thing. And speaking of which, what is the difference? And to Shadow Mint: Nifty idea, but well beyond the scope of the article. But I do agree, I would prefer to at least use libarys instead of doing it the "old-fashoned" way, but all the basics need to be taught. Not to mention that there is fun to be had in doing it all yourself. Speaking of libarys, coming up with a good way to do the databases is being pants, as I have some really nice DB libs, that few of the readers would also have access too. Do not meddle in the affairs of moderators, for they are subtle and quick to anger. ANDREW RUSSELL STUDIOS Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ] Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Asking Questions | Go FAQ yourself ] |
||||
|
||||
![]() Codejoy Member since: 5/25/2001 From: USA |
||||
|
|
||||
| Well I read the article (loved it and excited by it) and got the code for the system I am familiar with, MSVC (from the "Cow in the Well" guy). It compiled fine, and I tried to connect to it using telnet localhost 3000 it connects and crashed the program, upon some investigation it seemed that it did not like the value of rootuser on the line: if(rootuser){rootuser->prev = user;} in code:
CUser* CServer::AddUser()
{
CUser* user = new CUser;
user->next = rootuser;
if(rootuser){rootuser->prev = user;}
rootuser = user;
return user;
}
So I changed the CServer constructor from empty to this:
CServer::CServer()
{
rootuser=NULL;
}
it seems to connect and only crashes sometimes and I havent figured out how or why yet. I was just curious, if making the rootuser=NULL was a proper fix, and or if I did something wrong to begin with (or missed something) though not sure what I could of done wrong to begin with it was pretty straightforward: Downlaod Code Unzip it Compile and Run use telnet to connect to localhost port 3000 Any feedback here? Thanks for the good article! -Shane |
||||
|
||||
![]() Coaster Kev Member since: 5/2/2000 From: Virginia Beach, VA, United States |
||||
|
|
||||
| Great article. I've been interested in writing my own MUD for a while now, but I really didn't know how to make it work with telnet clients. I'm excited to see the rest of this article, and hopefully create my own MUD. Thanks a lot! [edited by - Coaster Kev on April 14, 2003 11:37:54 PM] |
||||
|
||||
![]() JoeKiller Member since: 3/11/2003 |
||||
|
|
||||
| Nice article Andrew! Shane, I had the same problem with the crash after connecting. Fixed the problem the same way as you and after that it worked fine I set the next and prev to NULL to in the constructor for CUser, I don't know if this is the way to go since I'm no expert, can someone else please comment on this? |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
| Now that was definatly bad codeing on my part. The reason that this happens is because when you use the if(rootuser) statement, it checks if rootuser != 0. NULL is defined as zero, so it is all good. If there is no root user (rootuser _should_ be defined as NULL in this case), it will create one. When there is no root user, the pointer should be NULL. However, when your compiler is alocating the pointer, it is leaving the memory just as it was (basicly filled with random data), while my compiler is probably both alocating the pointer as well as clearing the memory (to zero, ie: NULL). What is happening is that when it runs, it goes to the rootuser pointer and sees it is not equal to NULL, therefore decides that it must be a pointer (entering into block with the if statement) and tries to access (and modify) the memory at this point. This is Not A Good Thing(tm). There are (depending on a few things) three possible cases (if it is not NULL and not a proper pointer): The program tries to modify data outside the programs memory space. This causes the OS to go and yell "Access Violation". The program tries to modify data inside its memory space, causing it to overwrite some other variables, possibly other pointers (causing the above error) and generaly causing havoc and eventualy crashing (just as bad and harder to track down). The pointer points to something that won't cause either of the two above cases, and goes along its way (still not fantstic, though). This is pretty critical, so I have emailed dave new source (again). I will probably make a note of this in my next article too. And to all the praise: Thankyou very much, I am glad you enjoyed it. Part two will be online as soon as it can be. Do not meddle in the affairs of moderators, for they are subtle and quick to anger. ANDREW RUSSELL STUDIOS Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ] Articles :: [ MUD Pies ] Got Clue? :: [ Start Here | Google | MSDN | GDN Reference | OGL v D3D | Formats | Asking | Go FAQ yourself ] |
||||
|
||||
![]() Codejoy Member since: 5/25/2001 From: USA |
||||
|
|
||||
| Ya, I guess its some issue with visual C++ grabbing whatever is there if you dont explicity set a default value for any variable. In either case it seems to be running now, and damned if im not chompin at the bit for the next article Thanks again, Shane |
||||
|
||||
![]() Unwise owl Member since: 12/30/2001 From: Sweden, United States of Europe |
||||
|
|
||||
| Great article! I can't wait for the next part. |
||||
|
||||
![]() Coaster Kev Member since: 5/2/2000 From: Virginia Beach, VA, United States |
||||
|
|
||||
| Ready for part 2! My server doesn't do much! It's ready to do stuff now!! |
||||
|
||||
![]() dwarfsoft Moderator Member since: 6/5/2000 From: Toowoomba, Australia |
||||
|
|
||||
| Wow! Thanx AR for your ARticle... peh.. I suppose I can amuse myself with that one for a few more hours Anyways. I went on the differnt approach. I actually started making my game content and then sorted out how the server was operating. They are both fairly detached from each other appart from the sending of data and the logging of users. Much awaiting the next installment! |
||||
|
||||
![]() Xtreme11 Member since: 4/23/2003 From: Sydney, Australia |
||||
|
|
||||
| Hey Andrew I just wanted to compliment you on your article. Ive been trying to write my own mud but I was having too many problems writing the server code to work with telnet. Your article is just what I needed. Thanks again, cant wait to read next second part |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| GREAT article! Just the kind of fun trivia and do-it-yourself thing that hits the spot. Ah... Really looking forward to the next article! |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Downloaded the "Cow-Well" MSVC source code in fits of wild ecstasy at being enabled to start making my own mud - -but then when i try to make an executable off the mudsrv.cpp file by itself, the linker pukes! what the? sure, there's your primitive .exe file which i can connect to without a problem, but i can't modify/add/whatever the source code without figuring out why the original code is making the linker puke! |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
| Make sure you are putting the libarys into the project properly. I don't have MSVC so I can't help too much with it. To everyone else: Sorry about number two taking so long, the first article was left in the queue for quite a while, and although I am pleased it went up, it went up at a really bad time for me. I am afraid that the next one is still in progress, and won't be ready for at least another week or two. Three or four is probably a more accurate estimate. Do not meddle in the affairs of moderators, for they are subtle and quick to anger. ANDREW RUSSELL STUDIOS Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ] Articles :: [ MUD Pies ] Got Clue? :: [ Start Here | Google | MSDN | GDN Reference | OGL v D3D | Formats | Asking | Go FAQ yourself ] |
||||
|
||||
![]() cow_in_the_well GDNet+ Member since: 4/8/2000 From: Sydney, Australia |
||||
|
|
||||
quote: Please define "puke" - Thomas |
||||
|
||||
![]() Andrew Russell Moderator Member since: 11/23/2000 From: Brisbane, Australia |
||||
|
|
||||
quote:Since when did you start ending your posts with your name? |
||||
|
||||
![]() cow_in_the_well GDNet+ Member since: 4/8/2000 From: Sydney, Australia |
||||
|
|
||||
| I have for a long time now (its my sig -_^), its just that i hardly ever post - Thomas |
||||
|
||||
![]() Hyatus Member since: 11/7/2000 From: Roseburg, OR, United States |
||||
|
|
||||
| Are you still planning on finishing this? I rather enjoyed the first article and would like to see it finished out. Thanks! ^^;; -Hyatus "da da da" |
||||
|
||||
![]() ever Member since: 7/14/2003 |
||||
|
|
||||
| Ditto! Awesome job on the first part. I have yet to find anything on coding a mud server from the ground up as comprehensive as this! Thanks! |
||||
|
||||
![]() Tigra7 Member since: 6/9/2002 From: USA |
||||
|
|
||||
This line:socket = socket(AF_INET, SOCK_STREAM, 0); Comes up with an error message: Does not evaluate to a function. Any reason why this comes up? Also, I changed sock to socket, so that is why it says socket. |
||||
|
||||
|
Page: 1 2 »» All times are ET (US) ![]() |
Last Thread Next Thread ![]() |
|