[TUTORIAL] Gamecore r40250 Source Code Configuration

01/03/2014 06:49 redrpci2008#1
Hello, community!
This tutorial was made for the C++ noobs (those people who don't know the difference between a bool and an int), so please don't rage at me :D.
In this short how-to topic, I'll show you how to configurate the basic functions of the core from the source code, so you won't have to mess up with Hex editors, .diff files and so on, because there may be a high chance that the adresses (or offsets! - those 0x3678ABCD -like things) won't match up, because of the different compilers which are used etc...

So, the first thing you should do: choose your favorite branch (I'm using mainline :D), and follow this path:
Srcs / Server / game / src
In the src folder, you should find a source file called config.cpp. Open it. (It's logic, yeaah!)

Starting with line 24, you should encounter the declaration values. Here you will do your work:

[Only registered and activated users can see links. Click Here To Register...]

Warning! Some (shitty) compilers might give you some errors if you don't leave the tab spacing default. So, in order to prevent mistakes, I would advise you to enable the "Show all characters" function. In Notepad++, you only have to click this button:
[Only registered and activated users can see links. Click Here To Register...]

Warning no. 2! You can't change, for example, a string with an integer value, or a bool with a char! For example, bool test = true; may only have the values true or false! Google for "C++ data types" in order to learn more!

Well, if you got the preps right, this is a bit of what you can do:

Change the connection values

Change the server type

Change the limits

Foreign-empire whisper and Client version checking

At last, but not least, changing the ItemShop URL

I hope this topic is useful for somebody, and I would like to have some feedback, as I haven't really tested these, because my Windows Server 2003 on my other computer is doing some updates at the moment... :mad:

Have a nice day!
01/03/2014 07:15 .PolluX#2
looks interesting - time to learn c++ ! :D
Thanks for your Tutorial
01/03/2014 07:35 redrpci2008#3
Quote:
Originally Posted by .Poᴌᴌuᶍ View Post
looks interesting - time to learn c++ ! :D
Thanks for your Tutorial
You're welcome ;) Good luck in C++
01/03/2014 09:54 [uLow]NTX?!#4
Quote:
Originally Posted by redrpci2008 View Post
Hello, community!
This tutorial was made for the C++ noobs (those people who don't know the difference between a bool and an int), so please don't rage at me :D.
I think your an C++ noob too. An bool is an Byte which is 0 or 1. not an int.

(And for .RoThe, exactly its a Bit but the CPU cant adress anything smaler than a Byte.)
01/03/2014 10:10 .RoThe#5
Quote:
Originally Posted by [uLow]NTX?! View Post
I think your an C++ noob too. An bool is an Byte which is 0 or 1. not an int.
No, a Boolean has only 1Bit length. It can have either the value 1 or 0, there is no more space needed. Just for the record ^^
01/03/2014 10:12 .Inya#6
Quote:
Originally Posted by .RoThe View Post
No, a Boolean has only 1Bit length. It can have either the value 1 or 0, there is no more space needed. Just for the record ^^
thats what he said^^
01/03/2014 10:14 .RoThe#7
Quote:
Originally Posted by .InyaProduction View Post
thats what he said^^
1 Byte =/= 1 Bit

1 Byte = 8 Bit
01/03/2014 10:22 [uLow]NTX?!#8
Quote:
Originally Posted by .RoThe View Post
1 Byte =/= 1 Bit

1 Byte = 8 Bit
At the least its a Byte because the CPU cant address anything smaller
01/03/2014 10:27 .Inya#9
Quote:
Originally Posted by .RoThe View Post
1 Byte =/= 1 Bit

1 Byte = 8 Bit
Sry reading wrong is a big strengh of mine :D
01/03/2014 10:29 lukeido#10
What is the difference of theese branches?
01/03/2014 10:42 .RoThe#11
Quote:
Originally Posted by [uLow]NTX?! View Post
At the least its a Byte because the CPU cant address anything smaller
Alright thanks to your answer, I looked it up.

In fact it seems that the CPU indeed could adress bits, but it would be too slow.
( [Only registered and activated users can see links. Click Here To Register...] )

Nevertheless I was wrong, thanks^^
01/03/2014 11:11 redrpci2008#12
Quote:
Originally Posted by [uLow]NTX?! View Post
I think your an C++ noob too. An bool is an Byte which is 0 or 1. not an int.

(And for .RoThe, exactly its a Bit but the CPU cant adress anything smaler than a Byte.)
Please tell me how the hell do you store the value 4571 in a bool ;) I know that you can convert a bool to an int, but not viceversa!
01/03/2014 11:40 [uLow]NTX?!#13
Quote:
Originally Posted by redrpci2008 View Post
Please tell me how the hell do you store the value 4571 in a bool ;) I know that you can convert a bool to an int, but not viceversa!
That not an bool an bool can only be 0 or 1 ( false / true )
[Only registered and activated users can see links. Click Here To Register...]
Quote:
Boolean type: The boolean type, known in C++ as bool, can only represent one of two states, true or false.
01/03/2014 11:45 [uLow]Beni#14
Quote:
Originally Posted by [uLow]NTX?! View Post
That not an bool an bool can only be 0 or 1 ( false / true )
[Only registered and activated users can see links. Click Here To Register...]
You can save a char in bool (0 to 255) but a boolean is not always saved as a char, it could also be a long.

*(Unsigned char*)&a_bool = a_range_from255to0
01/03/2014 12:08 [uLow]NTX?!#15
Quote:
Originally Posted by [uLow]Beni View Post
You can save a char in bool (0 to 255) but a boolean is not always saved as a char, it could also be a long.

*(Unsigned char*)&a_bool = a_range_from255to0
I think your talking about Microsoft's "BOOL", iam talink about "bool / boolean".
Ive googled it and cant find anything wth an bool with a range of 0- 255.

Google says ALWAYS boo, = true / false (0/1)

[Only registered and activated users can see links. Click Here To Register...]