What's code what isn't. Also how to start reading code.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What's code what isn't. Also how to start reading code.

Coder
This
#include "handlers.h"

#include "arena.hpp"
#include "eodata.hpp"
#include "map.hpp"
#include "npc.hpp"
#include "party.hpp"
#include <ctype.h>

Is NOT, Yes it's in the source at the "top" of every Source file, All those are, Include dircectory's. Or you could call then an "attachment" Basically all they do is automatically add the code from (Example: arena.hpp) into "Talk.cpp"

Talk.cpp is were I got all those #Includes.

----------------
Here is a REAL! Code. It's simple small, But helpful 'Rather then relogging".

 else if (command.length() == 4 && command.compare(0,4,"save") == 0)
                {
                    this->player->character->Save();
                    this->player->character->ServerMsg(" Server Message Here.");
                }


It's pretty easy to read if you read it carefully and don't look at it as if it had 4 heads.

Command Length = Length of the commands
Command Compare = Kinda like a declaration

this->player->character = Well read what the 3 words say
Save(); Saves your character rather then re-logging, It's better then re-logging because you don't know when the server may crash or something.

ServerMsg = That's the server message, all that really does is tell you your character has been saved.
I plan to make tutorials on Coding. After I get my 20 Hours. Hopefully I'll be able to actually help this
server.

NOTE: Before anyone says anything about the "small" code not proving anything, mainly it was just to say that I can code, Is it my best answer is no.

I mainly wanted to point out that some things you can read, even if you can't make them.
Any questions or options post below.

~Coder.
*Wasn't really sure what to write for a title.

Contact me: devildude1990@live.com
My Admin App: Coder's Coder Admin App
Reply | Threaded
Open this post in threaded view
|

Re: What's code what isn't. Also how to start reading code.

Jasper11
Lol before you start with eoserv code give a basic tut on the basics of C++ because the guide you just gave is what someone else coded in reg C++
Reply | Threaded
Open this post in threaded view
|

Re: What's code what isn't. Also how to start reading code.

Coder
No, I never meant to give a tutorial on how to code, This is just to simply tell people that reading a command is easier then most think.
Contact me: devildude1990@live.com
My Admin App: Coder's Coder Admin App
Reply | Threaded
Open this post in threaded view
|

Re: What's code what isn't. Also how to start reading code.

Jasper
People cant jump right into it they need to first learn the basics