[Guide]CoEmu v2 Source Setup

05/26/2009 22:44 LetterX#1
ALRIGHT. I was bored and in the mood to help (rare...I know D=)

First things first, you NEED a C# compiler. If you're the classic nooby, then go get [Only registered and activated users can see links. Click Here To Register...].

Second, download the source located in this crazy topic: [Only registered and activated users can see links. Click Here To Register...].

Third - extract it with WinRAR (if you don't have it, get it here: [Only registered and activated users can see links. Click Here To Register...]).

Fourth, open the file called "CoEmu v2" or "CoEmu v2.sln".

Fifth, open the SOLUTIONS EXPLORER
[Only registered and activated users can see links. Click Here To Register...]

Sixth, on the side (where the SOLUTIONS EXPLORER popped out) click on the "plus" next to "CoEmu v2 GameServer" -> double click on "Database" (folder) -> "DatabaseConnections.cs".
Alright, edit the following lines with your MySQL credentials:
[Only registered and activated users can see links. Click Here To Register...]
Save it. You're done with MySQL for the Game Server.

Seventh, now double click on the "Connections" folder (in the SOLUTIONS EXPLORER), then go to "MasterSocket.cs"

Eighth, edit the following code:
[Only registered and activated users can see links. Click Here To Register...]
Insert the IP Address you'll be using to connect to the server. Save it.

POSSIBLE ERROR:
Some people are reporting that "OpenSSL" is a missing reference, so with the SOLUTION EXPLORER, go to "References" and delete the "ManagedOpenSsl" reference.
Next, go to the top and click on "Project" and "Add Reference". When there, click on "Browse" and link you're way to the GameServer's debug folder, where you'll click on ManagedOpenSsl.dll and then click Okay.
Alright! The game server is done.


Ninth, in the SOLUTION EXPLORER, minimize the "CoEmu v2 GameServer" solution (using the "minus") and then click on the "plus" for the "CoEmu v2 LoginServer". We'll be doing pretty much the exact same thing just with little more.

Tenth, double click "Database" (folder) -> "DatabaseConnections.cs".
Edit the same lines as before, so it should looks like this at first:
[Only registered and activated users can see links. Click Here To Register...]
Save it.

Eleventh, now double click "Connections" (folder) -> "MasterSocket.cs"
Edit the same lines as was in GameServer,
[Only registered and activated users can see links. Click Here To Register...]
Save it.

Twelfth, go to "PacketProcessor.cs" (in the root of the "CoEmu v2 LoginServer" solution). You'll need to find "if(ServerName == "CoEmu")". Edit that to the server name you'll be giving your server (or keep it as is).

Thirteenth, edit the following:
[Only registered and activated users can see links. Click Here To Register...]
Change that IP Address ("66.187.101.86") to the IP Address you used for the Game server.
Scroll down a little farther, you'll come across the same lines again, edit it again (and make the edits you made the same as your previous edit). This is so when people make a new account, they can continue on making a new character (instead of having to log in and out again because the Login Server is trying to send their client to a non-existent game server).

Fourteenth, there appears to be an error in the LoginServer, so go to "Main.cs" and then find:
Code:
Console.WriteLine("This program is a branch
This needs to be finished, so you can just add a " "); " to the end of it to end the WriteLine command. :O

NEW ADDITIONS ;O
Fifteenth, I am going to assume you have some form of MySQL installed & Apache + phpMyAdmin (if you use something else other than phpMyAdmin, no support will be given). Go to your phpMyAdmin folder (if on the same machine, 127.0.0.1/phpmyadmin is an example). Login.

Sixteenth, on the left navigation bar, look for under the phpMyAdmin image that says "SQL" in it.
[Only registered and activated users can see links. Click Here To Register...]

Seventeenth, go get the DB Backup Andy has (not recommended to use the one already in the Source RAR file, as it's empty compared to the other one now available).
[Only registered and activated users can see links. Click Here To Register...]

Eighteenth, then unRAR the file and click on "Import files" (as shown below):
[Only registered and activated users can see links. Click Here To Register...]
You'll want to navigate to the directory/folder you unRARed that database in and then click on it and select 'Okay'.

Nineteenth, let it upload. Once done, you now should have a new database called "conqueremu".

Twenty, you'll want to add an account so go to the database, then to the "accounts" table, and on the top navigation bar, click 'Insert'. Just insert your Account ID and click 'Go'.

Twenty-one, log into the server. Once you've made an account and logged out, go back to the database 'conqueremu', only this time click on the 'characters' table.

Twenty-two, click on the pen/pencil icon and once the page loads, go forth and edit the "ID" field to "1100000". This prevents other accounts and yourself from getting messed up. Don't worry about it anymore, as the DB auto increments the field.


ADDITIONAL ERROR:
If your project saves in the \bin\Release\ folder, you can edit it by having the selected solution/project active and then in the top bar, click on Project -> "CoEmu v2 LoginServer Properties" and/or "CoEmu v2 GameServer Properties". Once that loads, go to the "Build" tab and then at the last field, edit "\bin\Release\" to "\bin\debug\".

Congrats, your server is now done. Now you need to get a v5095 client and a modified Conquer.exe to edit the encrypted Server.dat.

So go here: [Only registered and activated users can see links. Click Here To Register...] to get the v5087 client & the needed patches.
When you install your client, rename "Autopatch.exe" to "Autopatch1" or just delete it... so when you run your patches, it doesn't automatically load autopatch.exe and then update to the latest version.

Next, replace the Conquer.exe (and Server.dat) with this one:
[Only registered and activated users can see links. Click Here To Register...].
This will allow the server.dat to be decrypted and editable.
Please note: the new Server.dat is done in XML format.

Note: Andy requests: THE ONLY THING I ASK OF YOU IS THAT YOU DO NOT REMOVE THE SOURCE CODE CREDITS, AND THAT YOU MENTION THAT YOUR SERVER IS RUN ON COEMU FOUNDATION SOURCE CODE. THAT'S IT!

Some additional issues known:
Please note: If you installed MySQL bundled with anything (like AppServ, XAMPP, WAMP, etc.), OR if you have installed MySQL in "Developer" mode, then you MUST remove the following from the GameServer "DatabaseConnections.cs":
[Only registered and activated users can see links. Click Here To Register...]
So that it looks like the following:
[Only registered and activated users can see links. Click Here To Register...]


'libeay32.dll' DOES NOT WORK on ANY VERSION of x64 Windows! This is important because 'libeay32.dll' is what 'ManagedOpenSsl.dll' wraps to. The game server will only run in a x86/32-bit environment.
In order for 'ManagedOpenSsl.dll' to work, you must re-wrap it to 'libeay64.dll' OR if you have Visual Studios (2008/2010), you can force the game server to run in a dedicated x86 mode.
Sorry for any inconvenience!


When making an account, once you've created you're character, you must go into the 'characters' table and edit your character's ID to 1100000 if you don't want errors!

I will offer limited help on this; if you have an error, chances are it's an error created by you and not this guide. Please do not PM me expecting or asking 1-on-1 help on this from me.

EDIT LOG:
edit [5.26.2009]: Added some extra text.
edit2 [5.26.2009]: I replaced most of the "[ code]" strings with actual images.
edit3 [5.27.2009]: Added more steps for the database and images.
edit4 [5.29.2009]: Added 'limited help' section.
edit5-6 [8.15/19.2009]: Fixed some grammatical errors & re-stated a line.
05/26/2009 22:49 PeTe Ninja#2
+K will help alot =]
05/26/2009 22:58 .Dan.#3
This helps like hell, but I still have one problem. On [Only registered and activated users can see links. Click Here To Register...] I can see my IP. If I enter it into the client and source and try to connect then it says that it is in a maintainance. Which means it's offline. Yes the source is up and running, so that can't be the problem.

Is my IP blocked or something, LOL!
Would appreciate some help,

~NubCake~
05/26/2009 22:58 Kiyono#4
Isn't this exactly the same as what Andy said except for the "You need a C# compiler" part?
05/26/2009 22:59 LetterX#5
Quote:
Originally Posted by Kiyono View Post
Isn't this exactly the same as what Andy said except for the "You need a C# compiler" part?
Pretty much but I do it step-by-step or.. in other words I hold your hand through the whole thing.

edit: At NubCake~:
Quote:
Originally Posted by NubCake~ View Post
This helps like hell, but I still have one problem. On [Only registered and activated users can see links. Click Here To Register...] I can see my IP. If I enter it into the client and source and try to connect then it says that it is in a maintainance. Which means it's offline. Yes the source is up and running, so that can't be the problem.

Is my IP blocked or something, LOL!
Would appreciate some help,

~NubCake~
You're most likely behind a router, and it's not configured to let 5816 and 9958 through. So when you try to connect, it can't access the ports.

So I recommend going to [Only registered and activated users can see links. Click Here To Register...] and see if your router is listed there. This will require you have access to your router's web page.
05/26/2009 23:03 Zanzibar#6
Wht are ports plawks.
05/26/2009 23:03 Kiyono#7
Quote:
Originally Posted by LetterX View Post
Pretty much but I do it step-by-step or.. in other words I hold your hand through the whole thing.

edit: At NubCake~:


You're most likely behind a router, and it's not configured to let 5816 and 9958 through. So when you try to connect, it can't access the ports.

So I recommend going to [Only registered and activated users can see links. Click Here To Register...] and see if your router is listed there. This will require you have access to your router's web page.
At least there is a thread where we can re-direct people to now.

//edit Are you by any chance Imitation from HCO/ACO?
05/26/2009 23:05 valyy#8
Work on Windows 7 ???
05/26/2009 23:07 Arcotemple#9
great guide LetterX
05/26/2009 23:08 Kiyono#10
Quote:
Originally Posted by valyy View Post
Work on Windows 7 ???
As long as it's 32-bit you could try it.
05/26/2009 23:12 LetterX#11
Quote:
Originally Posted by Kiyono View Post
//edit Are you by any chance Imitation from HCO/ACO?
Ya, I am. =d
05/26/2009 23:13 PeTe Ninja#12
Quote:
Originally Posted by LetterX View Post
Ya, I am. =d
:o i never knew that... i fail :( sorry
05/26/2009 23:15 LetterX#13
Quote:
Originally Posted by Zanzibar View Post
Wht are ports plawks.
They should be in the source...but 9958 & 5816.
05/26/2009 23:20 Kiyono#14
Quote:
Originally Posted by LetterX View Post
Ya, I am. =d
D=
Quote:
Originally Posted by LetterX View Post
They should be in the source...but 9958 & 5816.
I think that he asked: "What are port blocks?" not "Which ports?".
05/26/2009 23:21 araXis#15
Done everyhing but wont work.

GameServer Error ---->[Only registered and activated users can see links. Click Here To Register...]

Login Server Error ---->[Only registered and activated users can see links. Click Here To Register...]

Help me please.And i have C#.