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

04/03/2008 23:48 walmartboi#676
This should be in Database.cs, I fixed all the errors:

Code:
public static void UpdateCharWhMoney(COClient Client)
        {
            MySqlCommand Command = new MySqlCommand("UPDATE `Characters` Set `WHMoney` = ( + Client.Char.WhMoney + ) ) WHERE `CharID` = ); + Client.Char.CharID + "); 
            try
            {
                Command.ExecuteNonQuery();
            }
            catch
            {

            }
        }
04/04/2008 00:04 g_elf#677
Quote:
Originally Posted by Djago160 View Post
k i ported the Mob files from the 5011 release to this one but i have 1 problem the mobs don't spawn and they don't spawn either on the 5011(or im not searching at the rright place)
and where is the HP located cause normaly you login with 1 HP and and that is...well anoying
[edit]how do you change the service messages when you login
change this lines in PacketHandler.cs line 323

Code:
Client.SendData(CPacket.Chat(Client.MessageID, "SYSTEM", Client.Char.Name, "Welcome to CoFuture Online: Server Currently Under Heavy Development and Testing", ChatType.Service));
Client.SendData(CPacket.Chat(Client.MessageID, "SYSTEM", Client.Char.Name, "Authors: Korvacs & Future, You may contact Future (leavemealone) @ elitepvpers.com", ChatType.Service));
Does any1 know how to handle the WH? like show what is safe
04/04/2008 00:34 katanahack#678
Quote:
Originally Posted by damianpesta View Post
Prolly u doin wrong sumthin or running wrong Server.exe Thats why go check again and make sure everythin is right
No, im opening the right server.exe, this was just with a differnet CoFuture source, i got the one on here working.

Also, how can I use v4348 of the conquer client?
04/04/2008 16:06 Kiyono#679
i just found out that there was a WH script posted on CF
Code:
//GetbankMenoy.cs

using System;
using System.Collections.Generic;
using System.Text;
using COServer;

namespace COServer.clientpackets
{
class GetbankMenoy : GameBasePacket
{
private byte[] _packet;
private COClient _client;
public GetbankMenoy(byte[] packet, COClient client)
{
_packet = packet;
_client = client;

runImpl();
}

void runImpl()
{

int key = (_packet[0x013] << 24) + (_packet[0x012] << 16) + (_packet[0x011] << 8) + _packet[0x010];

int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];



byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney>> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);
}
}
}


// Collectmoney.cs
using System;
using System.Collections.Generic;
using System.Text;
using COServer.Network.Packet;

namespace COServer.clientpackets
{
class Collectmoney : GameBasePacket
{
private byte[] _packet;
private COClient _client;
ConquerPacket CPacket = new ConquerPacket();
public Collectmoney(byte[] packet, COClient client)
{
_packet = packet;
_client = client;

runImpl();
}
void runImpl()
{
int money = (int)((_packet[0x0b] << 24) + (_packet[0x0a] << 16) + (_packet[0x09] << 8) + _packet[0x08]);

int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];
if (_client.Char.WhMoney > (money-1))
{

_client.Char.WhMoney -= money;

_client.Char.Money += money;

int key = 0;

byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);
_client.SendData(CPacket.UpdateMoney(_client.Char));
}
}
}
}

//StorageMoney.cs

using System;
using System.Collections.Generic;
using System.Text;
using COServer.Network.Packet;

namespace COServer.clientpackets
{
class StorageMoney : GameBasePacket
{

private byte[] _packet;
private COClient _client;
ConquerPacket CPacket = new ConquerPacket();

public StorageMoney(byte[] packet, COClient client)
{
_packet = packet;
_client = client;

runImpl();
}

void runImpl()
{
int money =(int)((_packet[0x0b] << 24) + (_packet[0x0a] << 16) + (_packet[0x09] << 8) + _packet[0x08]);

int NPCid = (_packet[0x07] << 24) + (_packet[0x06] << 16) + (_packet[0x05] << 8) + _packet[0x04];


if (_client.Char.Money > money-1)
{

_client.Char.Money -= money;

_client.Char.WhMoney += money;


int key = 0;

byte[] data = new byte[] { 0x14, 0x00, 0xf1, 0x03, (byte)(NPCid & 0xff), (byte)((NPCid >> 8) & 0xff), (byte)((NPCid >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), (byte)(_client.Char.WhMoney & 0xff), (byte)((_client.Char.WhMoney >> 8) & 0xff), (byte)((_client.Char.WhMoney >> 16) & 0xff), (byte)((_client.Char.WhMoney >> 24) & 0xff), 0x09, 0x00, 0x00, 0x00, (byte)(key & 0xff), (byte)((key >> 8) & 0xff), (byte)((key >> 16) & 0xff), (byte)((key >> 24) & 0xff) };
_client.SendData(data);

_client.SendData(CPacket.UpdateMoney(_client.Char));
}
}
}
}


// RequestWarehouse.cs

using System;
using System.Collections.Generic;
using System.Text;
using COServer;
using COServer.Network.Packet;
using COServer.Network;

namespace COServer.clientpackets
{
class RequestWarehouse : GameBasePacket
{
private byte[] _packet;
private COClient _client;
private Character _char;
private int ItemID;
private int UID;

public RequestWarehouse(byte[] packet, COClient client)
{
_packet = packet;
_client = client;
runImpl();
}

void runImpl()
{
ConquerPacket CPacket = new ConquerPacket();
int Packet = (_packet[3] << 8) + (_packet[2]);
if (_client.Status == Mode.World)
{
if (Packet == 1102)
{
int NPCID = (_packet[7] << 24) + (_packet[6] << 16) + (_packet[5] << 8) + (_packet[4]);
int ItemUID = (_packet[15] << 24) + (_packet[14] << 16) + (_packet[13] << 8) + (_packet[12]);
int Type = (_packet[8]);
int Amount = 0;
int[][] warehouse = null;
if (NPCID == 8)//twincity
{
warehouse = _client.Char.TwinWare;
}
if (NPCID == 10012)//phoenix castle
{
// warehouse = _client.Char.PhoenixWare;
}
if (NPCID == 10028)//ape mountain
{
// warehouse = _client.Char.ApeWare;
}
if (NPCID == 10011)//desert city
{
// warehouse = _client.Char.DesertWare;
}
if (NPCID == 10027)//bird island
{
// warehouse = _client.Char.BirdWare;
}
if (NPCID == 44)//market
{
// warehouse = _client.Char.MarketWare;
}
if (Type == 0) // 返回銀行物品
{
foreach (int[] Item in warehouse)
{
if (Item[0] != 0)
{
Amount++;
}
}
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.getBankitem();
}
#region 銀行:
if (Type == 1) // 放物品
{
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.Saveitem(_packet);
}
else if (Type == 2) //拿物品
{
Warehouse GetWarehouse = new Warehouse(NPCID, Amount, 0, 0, _client);
GetWarehouse.Getitem(_packet);
}
#endregion
}
}
}
}

}
Code:
//PacketHandler.cs line 806


case 1102:
{
msg = new RequestWarehouse(data, Client);
break;
}


// line 239
case 9:
{
msg = new GetbankMenoy(data, Client);
//Console.WriteLine("[Client Packet]Item Packet: Warehouse <View>");
break;
}
case 10:
{
msg = new StorageMoney(data, Client);
break;
}
case 11:
{
msg = new Collectmoney(data, Client);
//Console.WriteLine("[Client Packet]Item Packet: Warehouse <Withdraw Money>");
break;
}
problem is i cna't get it to work
04/04/2008 21:06 Poision#680
am going to go try it out and make a private server lol
04/04/2008 21:27 Poision#681
Installing AppServ

- ServerName: localhost
- Password: (any password, but dont forget it because u need it to log into phpmyadmin)

for -ServerName: do we have to put in localhost?
04/04/2008 21:49 Poision#682
When i try to log into the /phpmyadmin it says put in user name and pass, but what is my user name, when i installed the Program i remeber setting a pass but not a user name.


nvm i got it
04/04/2008 22:36 Poision#683
I need a little help with step 5

5. Setting up Server to connect to Database

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!)

it says open the server folder but what server folder, and it says put in data base password, but what database password what do i do with the Server Source, and where is COFuture Project file, i cant find it.
04/05/2008 13:15 Kiyono#684
@Poisen don't quadruple post
04/05/2008 17:04 damianpesta#685
Dude Simple Step 5 Go to database.cs U need visual studio 2005/2008 Open database.cs go to line 39 (press ctrl+g And put in number 39 and go) Now You see sumthin like that:
string UserName = MakeSafeString("root");
string Password = MakeSafeString("put ur password there same as u gave 2 phpmyadmin while installing");

Go to Cofuture The Whole project And Click Cofuture And u will se buttong to Rebuild Click Rebuild And make sure Do it twice If it builds succesfully ITs ok just run CoServer.exe
04/05/2008 17:50 Poision#686
O ok thx but where is database.cs and where can i get a visual studio 2005/2008
04/05/2008 19:49 harie200#687
hoe doe je hack
04/05/2008 21:36 Kiyono#688
Quote:
Originally Posted by Poision View Post
O ok thx but where is database.cs and where can i get a visual studio 2005/2008
[Only registered and activated users can see links. Click Here To Register...]

get C# here

Quote:
Originally Posted by harie200 View Post
hoe doe je hack
wtf this is about servers not hacking
04/05/2008 23:38 Poision#689
Thx Djago160, and harie u dont make no sense lol
04/06/2008 15:07 Kiyono#690
does somebody know where HP and Mana are located cause i just noticed you don't jave mana and only 1 hp