Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 01:12

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

Advertisement



Guide/Release: Conquer Server (CoFuture) Using MySql!

Discussion on Guide/Release: Conquer Server (CoFuture) Using MySql! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old 03/31/2008, 15:38   #646

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by tanelipe View Post
I'm curious, Do you guys even bother to look what the type of Packet is?
Like the above SpawnMob Packet; Instead of trying to make it from scratch, look what Type it is; Tell me if you find the answer; (Hint : Has something to do with character spawning )


Look for the packet 0x3F9 for example : It has alot subtypes (10+?) It would be incredibly messy to code these each on their own, but instead you just change the values...(and subtype ofcourse)

P.S This is more like for the future referrence.

@nearmylimits : Download .NET FrameWork 2 or higher;
i have not done anything yet i posted when i was at school
Kiyono is offline  
Old 03/31/2008, 19:54   #647
 
elite*gold: 0
Join Date: Oct 2005
Posts: 31
Received Thanks: 1
Quote:
Originally Posted by tanelipe View Post
I'm curious, Do you guys even bother to look what the type of Packet is?
Like the above SpawnMob Packet; Instead of trying to make it from scratch, look what Type it is; Tell me if you find the answer; (Hint : Has something to do with character spawning )


Look for the packet 0x3F9 for example : It has alot subtypes (10+?) It would be incredibly messy to code these each on their own, but instead you just change the values...(and subtype ofcourse)

P.S This is more like for the future referrence.

@nearmylimits : Download .NET FrameWork 2 or higher;
i know jack about packets im learning from what i see, and ur **** right, the mob packet e quite alike te char spawn packet.

so how can i know how the packet is made and how can i "translate it"? and how can i know how many subtypes it has?

tks for the tips
g_elf is offline  
Old 03/31/2008, 20:39   #648
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
I don't think there is any proper way of knowing how many SubTypes some of the packets have, unless ofcourse you get hands on original CO source, you just come across them while logging packets from wherever you log your packets from. :P

Packets and how they are made....uhm; It's hard to explain.

The bytes from 0..1 (First two of the byte[] Array, (in C#)) are the size of Packet
1..2 are the Packet Type; Like for example the character spawn packet 0x3F6

Those first 4 bytes are always at same place; But the rest of them don't follow any pattern (Unless they're same PType of course)

Lets take the AuthResponse packet for example (Smallest packet perhaps? xD)

20 00 F1 04 XX XX XX XX YY YY YY YY II II II II II II II II II II II II II II II II PP PP RR RR

XX = KeyTwo
YY = KeyOne
II = IP
PP = GamePort
RR = Reserved

Excuse me for that gay format, but those values change in the packet, they're not preset

0..1 : Size
2..3 : Type (0x41F in this case)
4..7 : KeyTwo
8..11 : KeyOne
12..27 : The GameIP (Not always this long, reserved for xxx.xxx.xxx.xxx ip's)
28..29 : GamePort
30..31 : Nothing; It's just 00 00

Now! Let's make that to a something we can send!
Code:
// This style is mostly used in COEmu based things, unless using streams
public static byte[] AuthResponse(string IP, uint KeyOne, uint KeyTwo, ushort GamePort)
{
  byte[] Packet = new byte[0x20]; // 0x20 in hex, 32 in dec
  Packet[0] = (byte)(Packet.Length & 0xFF);
  Packet[1] = (byte)((Packet.Length >> 8) & 0xFF);
  Packet[2] = (byte)(0x41F & 0xFF);
  Packet[3] = (byte)((0x41F >> 8) & 0xFF);
  Packet[4] = (byte)(KeyTwo & 0xFF);
  Packet[5] = (byte)((KeyTwo >> 8) & 0xFF);
  Packet[6] = (byte)((KeyTwo >> 16) & 0xFF);
  Packet[7] = (byte)((KeyTwo >> 24) & 0xFF);
  Packet[8] = (byte)(KeyOne & 0xFF);
  Packet[9] = (byte)((KeyOne >> 8) & 0xFF);
  Packet[10] = (byte)((KeyOne >> 16) & 0xFF);
  Packet[11] = (byte)((KeyOne >> 24) & 0xFF);
  for(byte i = 0; i < IP.Length; i++)
   Packet[12 + i] = (byte)IP[i];
  Packet[28] = (byte)(GamePort & 0xFF);
  Packet[29] = (byte)((GamePort >> 8) & 0xFF);
  // 30..31 Don't have to be declared since they're alwayss 00
  return Packet; 
}
P.S If you copy this; It won't probably work for your server version;
P.P.S There might be _some_ errors, wrote it here; Didn't have compiler open
tanelipe is offline  
Thanks
1 User
Old 03/31/2008, 21:08   #649
 
elite*gold: 0
Join Date: Oct 2005
Posts: 31
Received Thanks: 1
@tanelipe:

tks for the explanation, now im starting to understand something.

so i have to get the packets and compare them to find what changes and when right?

does any1 have a packet snnifer or something like that?

Edit: i just decripted the packet i posted before and guess what ... its the char packet, same id
Type(1014); == PacketData[2] = 0xf6; PacketData[3] = 0x03; == 0x3f6 == 1014

so spawning a mob its like spawning a char? only changes the mech? hum
g_elf is offline  
Old 04/01/2008, 01:58   #650
 
elite*gold: 0
Join Date: Mar 2008
Posts: 3
Received Thanks: 0
I get this error when ever someone trys to log in, help please.

nearmylimits is offline  
Old 04/01/2008, 03:43   #651
 
elite*gold: 0
Join Date: Oct 2005
Posts: 31
Received Thanks: 1
Quote:
Originally Posted by nearmylimits View Post
I get this error when ever someone trys to log in, help please.

try cheking the port nš in the server.dat and in the server DB are the sameand probably should be 9958.
g_elf is offline  
Old 04/01/2008, 11:11   #652

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
well not really a problem but just anoying when i login i get the 317 error even though i fixed it long ago any idea on how to remove the message?caus ei don't it to look at errors
Kiyono is offline  
Old 04/01/2008, 11:30   #653
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
@Djago160 : Look for Korvac's post @ page 40; There should be all the information needed to fix that error.

@Djago160 : I'd suggest you to keep those error messages popping to console, much easier to debug source of problem. :P But if you really wan't to have all those removed, look for :
Code:
try
{

}
catch(Exception e) // Can be something else than 'e' also
{
  Console.WriteLine(e.toString());
}
And remove the Console.WriteLine part.
tanelipe is offline  
Old 04/01/2008, 13:42   #654

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by tanelipe View Post
@Djago160 : Look for Korvac's post @ page 40; There should be all the information needed to fix that error.

@Djago160 : I'd suggest you to keep those error messages popping to console, much easier to debug source of problem. :P But if you really wan't to have all those removed, look for :
Code:
try
{

}
catch(Exception e) // Can be something else than 'e' also
{
  Console.WriteLine(e.toString());
}
And remove the Console.WriteLine part.
well if it's better to leave them there i will
Kiyono is offline  
Old 04/01/2008, 13:51   #655
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
IMO it's better to have it so it'll output anything that cause errors. I'm not sure but C# might do this actually by default (output exceptions) but if you catch it with that try {} catch {} statement, You can do various things, ex :

e.Message (shows the error message),

e.Source (shows the application/object that causes error)

and you can can also add your own lines inside the catch { }

Code:
int StrToInt(string tConvert) {
  int RtnValue = 0;
  try { 
    RtnValue = Convert.ToInt32(tConvert);
  } 
  catch {
    Console.WriteLine("Could not convert string {0} to Integer..returning 0", tConvert);
    RtnValue = 0;
  }
  return RtnValue;
}

and so on... :P
tanelipe is offline  
Old 04/01/2008, 17:56   #656

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
well i was bored so i fixed the @scroll command

Code:
 else if (Splitter[0] == "@scroll")
                    {
                        if (Splitter[1] == "tc")
                        {
                            int x = 438; int y = 377;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.TwinCity;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
                        else if (Splitter[1] == "am")
                        {
                            int x = 566; int y = 565;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.ApeMoutain;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
                        else if (Splitter[1] == "ma")
                        {
                            int x = 211; int y = 196;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.Market;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
                        else if (Splitter[1] == "bi")
                        {
                            int x = 723; int y = 573;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.BirdIsland;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
                        else if (Splitter[1] == "dc")
                        {
                            int x = 496; int y = 649;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.DesertCity;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
                        else if (Splitter[1] == "pc")
                        {
                            int x = 232; int y = 260;
                            Client.Char.CurrentLoc = new Location(x, y);
                            Client.Char.Map = Map.Maps.PhoenixCastle;
                            Client.SendData(CPacket.GeneralData(Client.Char.CharID, 1002, 438, 377, DataType.ChangeMap));
                            Spawn.Remove(Client);
                            Client.SendData(CPacket.CharInfo(Client.Char));
                            Client.Char.Map = (Map.Maps)Convert.ToInt32(Splitter[1]);
                            Client.Char.CurrentLoc = new Location(Convert.ToInt32(Splitter[2]), Convert.ToInt32(Splitter[3]));
                            Spawn.UpdateLocal(Client, CPacket.SpawnChar(Client.Char));
                        }
Note: if you scroll you will be teleported to TC first then your destination
Kiyono is offline  
Old 04/01/2008, 20:28   #657
 
elite*gold: 0
Join Date: Oct 2005
Posts: 31
Received Thanks: 1
ok mob packet done, only spawns the mobs the rest has to done in the mob classes

its the char packet altered

public byte[] SpawnMob(int ID, int Mech, int mob_x, int mob_y, string Name, int HP, int LVL, int POS, string Status, int ANIM)
{
if (HP < 0)
HP = 0;
if (POS < 0)
POS = 0;
int MobStatus = Convert.ToInt32(Status, 16);
Length((65 + Name.Length));
Type(1014);
Long(ID);
Long(Mech);
Long(MobStatus); // shield, stigma, alive, dead, dead and desapear
Long(0);
Long(0);
Long(0);
Long(0);
Long(0);
Long(0);
Long(0);
Long(0);
Short(HP);
Short(LVL);
Short(mob_x);
Short(mob_y);
Short(0);
//Short(330);
//ByteInt(74);
//ByteInt(1);
ByteInt(POS);
ByteInt(ANIM); // animation 100-normal 150-peck
Short(0);
ByteInt(1);
ByteInt(Name.Length);
for (int x = 0; x < Name.Length; x++)
{
Byte(Convert.ToByte(Name[x]));
}
return getBytes();
}

it spawns the mobs with name
if u want them to walk, atk, have hp bar u have to "class it"

tks all that explained me how packets work
g_elf is offline  
Old 04/02/2008, 00:08   #658
 
elite*gold: 0
Join Date: Jan 2008
Posts: 10
Received Thanks: 0
Quote:
Open "Server" folder then Open the "CoFuture" Project File then open Database.cs and press "ctrl+g" and go to line "39" change "Database Username" to your databases username then on line "40" change "Database Password" to your databases password" and then on line "44" change "Database Name" to "conquer_server" unless you changed the database name. then go to Build --> Build Solution (Solution should build successfully!)
So when you say Database Username, do you mean our phpMyAdmin username and password???
(YES)

[EDIT]
I open Database.cs with Microsoft Visual Basic 2008 Express Edition, but there is no Build->Build Solution... how do I get this?

[EDIT-2]
Kay I got it working, You need Visual C#, and open CoFuture.csproj with it. =D
katanahack is offline  
Old 04/02/2008, 03:11   #659


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
@Djago160:

Quote:
Client.SendData(CPacket.GeneralData(Client.Char.Ch arID, 1002, 438, 377, DataType.ChangeMap));
replace all of the lines similar to the one above with this in your scroll command to stop the tc teleporting bit

Quote:
Client.SendData(CPacket.GeneralData(Client.Char.Ch arID, Client.Char.Map, x, y, DataType.ChangeMap));
Korvacs is offline  
Old 04/02/2008, 05:10   #660
 
elite*gold: 0
Join Date: Jan 2008
Posts: 10
Received Thanks: 0
I have Qonquer v. 9999, I have run the server Connection is Successful.
But when I open Qonquer and try to connect to the server, it says error dude to matinence. Obviously there isn't any matinence, so how do I connect to the Server?
katanahack is offline  
Closed Thread


Similar Threads Similar Threads
[Guide]cofuture source
06/11/2011 - CO2 PServer Guides & Releases - 91 Replies
hi guys am new here and i hope stay here for long time ------------ i make this guide Couz i found alot pll cant work with cofuture source --------------- Coder source:future <<<Thanks to hime 1st helping me:haydeZ<<<<Thanks to hime 2nd --------------------------------------- What we are need? 1:cofuture source>>>Download Here 2:AppServ(MySQL, Apache, and PhpMyAdmin all in one)>>>>AppServNetwork
[Request]Conquer Server (CoFuture) Using MySql
06/25/2008 - Conquer Online 2 - 2 Replies
hey I want to get the Conquer Server (CoFuture) Using MySql Source but all links down Can someone add it on rapidshare? or other Site? thank you if you up it in a site ps:sorry for my bad english :)
Need help Guide/Release: Conquer Server (CoFuture) Using MySql!
05/28/2008 - Conquer Online 2 - 1 Replies
Hello i tryed that Guide/Release: Conquer Server (CoFuture) Using MySql! But it don't work i can't do that phpmyadmin think anyone can help me the language is german but i wanted to change it to english but idk how. If anyone got Teamviewer or somethink like that would be nice greetz



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.