Register for your free account! | Forgot your password?

You last visited: Today at 09:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Guide]CoEmu v2 Source Setup

Discussion on [Guide]CoEmu v2 Source Setup within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old 01/29/2010, 22:32   #211
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
it's usually bundled with whatever mysql package you are using such as xaxmpp or wamp.

Personally I use xampp but it's personal preference... ooh and I really don't like phpmyadmin. Navicat works so much better imo for handling mysql data. Google it, they have a free lite version that will really be all you need for this.
pro4never is offline  
Old 02/24/2010, 21:09   #212
 
elite*gold: 0
Join Date: Jan 2007
Posts: 2
Received Thanks: 0
how come wen i import the database back up i get an error?
azi0npride is offline  
Old 02/25/2010, 05:04   #213
 
CIRASH's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 259
Received Thanks: 73
Use the other database that andy referred to in his thread.
CIRASH is offline  
Old 03/06/2010, 23:51   #214
 
dieg900's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 86
Received Thanks: 2
Red face

Hello good day

I know this post is a bit old, but I need your help.

I tried to lift the server, but I get an error when running the gameserver and login server.
I leave you some pictures to see if I can help in favor. I'm so tired I can not, for more you move.

I used Navicat...

These are some pictures, tell me if I am well please...

EDIT: This is the code of loginserver, packetsprocessors.cs

Quote:
//*
* Created by SharpDevelop.
* User: sams
* Date: 3/8/2009
* Time: 12:38 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using CoEmu_v2_LoginServer.Connections;
using CoEmu_v2_LoginServer.Database;

namespace CoEmu_v2_LoginServer
{
/// <summary>
/// Allows for handling of packets from the client->loginserver or client->gameserver.
/// </summary>
public static class PacketProcessor
{
public static void ProcessPacket(byte[] Data, ClientSocket CSocket)
{
int Type = (Data[3] << 8) + Data[2];
switch(Type)
{
case 1086:
{
RequestLogin(Data, CSocket);
break;
}
default:
{
Console.WriteLine("[LoginServer] Unknown packet type: " + Type);
break;
}
}
}
public static void RequestLogin(byte[] Data, ClientSocket CSocket)
{
string AccountName = "";
string Password = "";
string ServerName = "";
if(Data.Length >= 276)
{
for (int i = 4; i < 0x114; i++)
{
if (i >= 0x14 && i < 0xf9)
{
if(Data[i] != 0x00)
Password += (Convert.ToString(Data[i], 16)).PadLeft(2, '0');
}
if (i < 0x14)
if (Data[i] != 0x00)
AccountName += Convert.ToChar(Data[i]);
if (i > 0xfa)
if (Data[i] != 0x00)
ServerName += Convert.ToChar(Data[i]);
}
}
else
{
return;
}
/* if(AccountName != "dsfreak")
{
CSocket.Disconnect();
return;
}*/
System.Random Random = new System.Random();
Console.WriteLine("[LoginServer] " + AccountName + " logging in to " + ServerName);
string DBPass = Database.Database.Password(AccountName);
//TODO: Check for ban.
if(DBPass != "ERROR")
{
if(DBPass == Password)
{
//OKAY to login!
uint Key = (uint)(Random.Next(10000000) << 32);
Key = Key << 32;
Key = (uint)(Key | (uint)Random.Next(10000000));
byte[] Key1 = new byte[4];
byte[] Key2 = new byte[4];
Key1[0] = (byte)(((ulong)Key & 0xff00000000000000L) >> 56);
Key1[1] = (byte)((Key & 0xff000000000000) >> 48);
Key1[2] = (byte)((Key & 0xff0000000000) >> 40);
Key1[3] = (byte)((Key & 0xff00000000) >> 32);
Key2[0] = (byte)((Key & 0xff000000) >> 24);
Key2[1] = (byte)((Key & 0xff0000) >> 16);
Key2[2] = (byte)((Key & 0xff00) >> 8);
Key2[3] = (byte)(Key & 0xff);
if(ServerName == "Codieg900")
{
/*if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}*/
if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("127.0.0.1", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if(ServerName == "CoEmu.Nano")
{
if(AuthSocket.Authorize(AccountName, Key, true))
{
CSocket.Send(Packets.AuthResponse("70.190.77.101", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else if(DBPass == "")
{
Console.WriteLine("[LoginServer](Diagnostic) Set password for " + AccountName);
Database.Database.SetPass(AccountName, Password);
//OKAY to login!
uint Key = (uint)(Random.Next(10000000) << 32);
Key = Key << 32;
Key = (uint)(Key | (uint)Random.Next(10000000));
byte[] Key1 = new byte[4];
byte[] Key2 = new byte[4];
Key1[0] = (byte)(((ulong)Key & 0xff00000000000000L) >> 56);
Key1[1] = (byte)((Key & 0xff000000000000) >> 48);
Key1[2] = (byte)((Key & 0xff0000000000) >> 40);
Key1[3] = (byte)((Key & 0xff00000000) >> 32);
Key2[0] = (byte)((Key & 0xff000000) >> 24);
Key2[1] = (byte)((Key & 0xff0000) >> 16);
Key2[2] = (byte)((Key & 0xff00) >> 8);
Key2[3] = (byte)(Key & 0xff);
if(ServerName == "CoEmu")
{
/*if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}*/
if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if(ServerName == "CoEmu.Nano")
{
if(AuthSocket.Authorize(AccountName, Key, true))
{
CSocket.Send(Packets.AuthResponse("70.190.77.101", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else
{
CSocket.Send(Packets.WrongPass());
CSocket.Disconnect();
}
}
else
{
Console.WriteLine("DBPass equals ERROR: " + DBPass);
CSocket.Disconnect();
}
}
}
}
Attached Images
File Type: jpg conquerduda.jpg (199.4 KB, 9 views)
File Type: jpg conquerdude2.jpg (161.4 KB, 8 views)
File Type: jpg databaseconectio.jpg (161.3 KB, 8 views)
File Type: jpg dude2.jpg (173.3 KB, 10 views)
File Type: jpg navicat.jpg (86.4 KB, 7 views)
dieg900 is offline  
Old 03/07/2010, 01:17   #215
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
You have that completely messed up.

Revert back to the ORIGINAL file for it and change only server name and ip addresses instead of quoting them out and creating your own.


First one should be external ip (eg: CoEmu) second ones should be local ip (Eg: CoEmu.Nano)

Make sure to change BOTH and make sure they match.
pro4never is offline  
Old 03/07/2010, 02:01   #216
 
dieg900's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 86
Received Thanks: 2
Quote:
Originally Posted by pro4never View Post
You have that completely messed up.

Revert back to the ORIGINAL file for it and change only server name and ip addresses instead of quoting them out and creating your own.


First one should be external ip (eg: CoEmu) second ones should be local ip (Eg: CoEmu.Nano)

Make sure to change BOTH and make sure they match.
I check where is the local ip and change it, I am more or less well.

Quote:
*
* Created by SharpDevelop.
* User: sams
* Date: 3/8/2009
* Time: 12:38 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using CoEmu_v2_LoginServer.Connections;
using CoEmu_v2_LoginServer.Database;

namespace CoEmu_v2_LoginServer
{
/// <summary>
/// Allows for handling of packets from the client->loginserver or client->gameserver.
/// </summary>
public static class PacketProcessor
{
public static void ProcessPacket(byte[] Data, ClientSocket CSocket)
{
int Type = (Data[3] << 8) + Data[2];
switch(Type)
{
case 1086:
{
RequestLogin(Data, CSocket);
break;
}
default:
{
Console.WriteLine("[LoginServer] Unknown packet type: " + Type);
break;
}
}
}
public static void RequestLogin(byte[] Data, ClientSocket CSocket)
{
string AccountName = "";
string Password = "";
string ServerName = "";
if(Data.Length >= 276)
{
for (int i = 4; i < 0x114; i++)
{
if (i >= 0x14 && i < 0xf9)
{
if(Data[i] != 0x00)
Password += (Convert.ToString(Data[i], 16)).PadLeft(2, '0');
}
if (i < 0x14)
if (Data[i] != 0x00)
AccountName += Convert.ToChar(Data[i]);
if (i > 0xfa)
if (Data[i] != 0x00)
ServerName += Convert.ToChar(Data[i]);
}
}
else
{
return;
}
/* if(AccountName != "dsfreak")
{
CSocket.Disconnect();
return;
}*/
System.Random Random = new System.Random();
Console.WriteLine("[LoginServer] " + AccountName + " logging in to " + ServerName);
string DBPass = Database.Database.Password(AccountName);
//TODO: Check for ban.
if(DBPass != "ERROR")
{
if(DBPass == Password)
{
//OKAY to login!
uint Key = (uint)(Random.Next(10000000) << 32);
Key = Key << 32;
Key = (uint)(Key | (uint)Random.Next(10000000));
byte[] Key1 = new byte[4];
byte[] Key2 = new byte[4];
Key1[0] = (byte)(((ulong)Key & 0xff00000000000000L) >> 56);
Key1[1] = (byte)((Key & 0xff000000000000) >> 48);
Key1[2] = (byte)((Key & 0xff0000000000) >> 40);
Key1[3] = (byte)((Key & 0xff00000000) >> 32);
Key2[0] = (byte)((Key & 0xff000000) >> 24);
Key2[1] = (byte)((Key & 0xff0000) >> 16);
Key2[2] = (byte)((Key & 0xff00) >> 8);
Key2[3] = (byte)(Key & 0xff);
if(ServerName == "Codieg900")
{
/*if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}*/
if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("127.0.0.1", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if(ServerName == "CoEmu.Nano")
{
if(AuthSocket.Authorize(AccountName, Key, true))
{
CSocket.Send(Packets.AuthResponse("70.190.77.101", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else if(DBPass == "")
{
Console.WriteLine("[LoginServer](Diagnostic) Set password for " + AccountName);
Database.Database.SetPass(AccountName, Password);
//OKAY to login!
uint Key = (uint)(Random.Next(10000000) << 32);
Key = Key << 32;
Key = (uint)(Key | (uint)Random.Next(10000000));
byte[] Key1 = new byte[4];
byte[] Key2 = new byte[4];
Key1[0] = (byte)(((ulong)Key & 0xff00000000000000L) >> 56);
Key1[1] = (byte)((Key & 0xff000000000000) >> 48);
Key1[2] = (byte)((Key & 0xff0000000000) >> 40);
Key1[3] = (byte)((Key & 0xff00000000) >> 32);
Key2[0] = (byte)((Key & 0xff000000) >> 24);
Key2[1] = (byte)((Key & 0xff0000) >> 16);
Key2[2] = (byte)((Key & 0xff00) >> 8);
Key2[3] = (byte)(Key & 0xff);
if(ServerName == "CoEmu")
{
/*if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}*/
if(AuthSocket.Authorize(AccountName, Key, false))
{
CSocket.Send(Packets.AuthResponse("66.187.101.86", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
else if(ServerName == "CoEmu.Nano")
{
if(AuthSocket.Authorize(AccountName, Key, true))
{
CSocket.Send(Packets.AuthResponse("70.190.77.101", Key1, Key2));
}
else
{
CSocket.Disconnect();
}
}
}
else
{
CSocket.Send(Packets.WrongPass());
CSocket.Disconnect();
}
}
else
{
Console.WriteLine("DBPass equals ERROR: " + DBPass);
CSocket.Disconnect();
}
}
}
}
I hope this good.

Greetings
dieg900 is offline  
Old 03/07/2010, 14:55   #217
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
You still have it wrong.

Match them up...

Eg: Codieg900 you have 127.0.0.1 then 2 sec later you have for the same connection CoEmu 66.187.101.86 with a clone of it commented out...


1 for local... 1 for external... it's not that hard to do.
pro4never is offline  
Old 03/08/2010, 20:13   #218
 
dieg900's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 86
Received Thanks: 2
Quote:
Originally Posted by pro4never View Post
You still have it wrong.

Match them up...

Eg: Codieg900 you have 127.0.0.1 then 2 sec later you have for the same connection CoEmu 66.187.101.86 with a clone of it commented out...


1 for local... 1 for external... it's not that hard to do.
Ok, brother, thanks, already understood.

But still not work for me, I think is the sql.

Try to make me a User, and switch to another without the root, but it did not work, that may be?
dieg900 is offline  
Old 04/10/2010, 11:52   #219
 
elite*gold: 0
Join Date: Dec 2009
Posts: 1
Received Thanks: 0
when i run CoEmu game server and CoEmu login server i get "CoEmu Game Server has stopped working".
Civilnavy is offline  
Old 04/10/2010, 19:17   #220
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by Civilnavy View Post
when i run CoEmu game server and CoEmu login server i get "CoEmu Game Server has stopped working".
try running it through the debugger in C#. Sounds to me like you are probably using a 64 bit system without using the 64 bit dll (do a search, it's libeay32.dll or something like that)

If not, post what errors you get and we can try to help you (always use debugger, it will give you way more info to track down problems.
pro4never is offline  
Old 04/12/2010, 00:12   #221
 
elite*gold: 0
Join Date: Jun 2008
Posts: 4
Received Thanks: 0
When i try to log in the server and create a character, it stucks at "Logging into acount server".
Pikolando is offline  
Old 04/12/2010, 04:57   #222
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Again, sounds like you aren't using ips correctly (website ip being same as server ip, not matching up various ip's properly, etc)

CoEmu is really simple to setup and yet people still seem to get these things all the time... SEARCH please, the fixes for like every possible coemu error have been posted a billion times.
pro4never is offline  
Old 04/18/2010, 21:00   #223
 
elite*gold: 0
Join Date: Apr 2010
Posts: 4
Received Thanks: 0
what should i do if i have windows 7 x64?
albinekroth is offline  
Old 04/19/2010, 02:18   #224
 
t_dubble_uu's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 181
Quote:
Originally Posted by albinekroth View Post
what should i do if i have windows 7 x64?
Get the x64 libeay32.dll or compile it in x86 mode which always works for me.

or try my version of the coemu source
t_dubble_uu is offline  
Old 04/21/2010, 20:44   #225
 
ninjashinobi's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 54
Received Thanks: 10
how the **** i open a ".SLN" file???
ninjashinobi is offline  
Closed Thread


Similar Threads Similar Threads
[Guide] CoEmu Setup+LoginFix+Line30,31,34 Fix
03/09/2010 - CO2 PServer Guides & Releases - 17 Replies
Setting Up CoEmuV2 Download everything Here Download Client from Here Thanks andy123 and BrokeN^WinG Now let's start...
[Guide] How to setup Reflex Source
09/11/2009 - CO2 PServer Guides & Releases - 14 Replies
hey 4 people pmed me that they dont know how to setup a source and i saw that beta and someone else didnt knew it eiter how to set it up so here is a guide. Downloads: The Source (http://www.elitepvpers.com/forum/co2-pserver-discu ssions-questions/197876-release-project-reflex-sou rce-v1-0-a.html) APPServer 2.6.0 (AppServNetwork) Co Client Patch 5017 (Conquer_2.0.rar - FileFront.com) Note: People with Windows Vista need APPserver 2.5.1 The Final Guide:
I need some one to setup a Coemu source for me please....
07/03/2009 - CO2 Private Server - 1 Replies
Add meh on msn if u wanna help [email protected] thanx<3 i just want some one to setup it on navicat or w/e :)



All times are GMT +1. The time now is 09:01.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.