This is not the CoEmu by Andy. This is my custom source. It's still under development and as of now the auth is only finished.
Why did I call it CoEmu then?
I like the name and basically it means Co Emulator.
It's running on patch 4267 (Will run fine with a 4274 client).
It has support for multiple game-servers as well.
It uses MSSQL for database.
I have quite a lot of ideas with the source, but you'll see later on ;).
I'll be posting the database once I've finished the login sequence (Should be able to in about a day or so.)
Revision 1:
Added a database manager for sql,working like following:
INSERT
UPDATE
SELECT
DELETE
Feedback would be appreciated a lot, because then I would be able to know what I could do better and what errors there is, tho not much coded atm. then there is more to come.
Why did I call it CoEmu then?
I like the name and basically it means Co Emulator.
It's running on patch 4267 (Will run fine with a 4274 client).
It has support for multiple game-servers as well.
It uses MSSQL for database.
I have quite a lot of ideas with the source, but you'll see later on ;).
I'll be posting the database once I've finished the login sequence (Should be able to in about a day or so.)
Revision 1:
Added a database manager for sql,working like following:
INSERT
Code:
Exception sqlException;
// Inserting an account with the name "NewAccount" and the password "1234"
if ((sqlException = new CoEmu.Database.DBManager("Accounts", CoEmu.Database.DBCommandType.INSERT, connectionString)
.AddParam("AccountName", System.Data.SqlDbType.VarChar, "NewAccount")
.AddParam("AccountPass", System.Data.SqlDbType.VarChar, "1234")
.AddParam("AccountBanned", System.Data.SqlDbType.TinyInt, 0)
.Execute()) != null)
Console.WriteLine(sqlException.ToString());
Code:
Exception sqlException;
// Updating the password of "NewAccount" to 1337
if ((sqlException = new CoEmu.Database.DBManager("Accounts", CoEmu.Database.DBCommandType.UPDATE, connectionString)
.AddParam("AccountPass", System.Data.SqlDbType.VarChar, "1337")
.AddWhere("AccountName", System.Data.SqlDbType.VarChar, "NewAccount")
.Execute()) != null)
Console.WriteLine(sqlException.ToString());
Code:
Exception sqlException;
// Selecting "NewAccount" and printing its data out
CoEmu.Database.DBCollection coll = new CoEmu.Database.DBManager("Accounts", CoEmu.Database.DBCommandType.SELECT, connectionString)
.AddParam("AccountID", System.Data.SqlDbType.Int)
.AddParam("AccountName", System.Data.SqlDbType.VarChar)
.AddParam("AccountPass", System.Data.SqlDbType.VarChar)
.AddParam("AccountBanned", System.Data.SqlDbType.TinyInt)
.AddWhere("AccountName", System.Data.SqlDbType.VarChar, "NewAccount")
.ExecuteReader(out sqlException);
if (sqlException != null)
Console.WriteLine(sqlException.ToString());
else if (coll.HasItems())
{
Console.WriteLine("{0} : {1}", coll["AccountID"].Column, (uint)coll["AccountID"]);
Console.WriteLine("{0} : {1}", coll["AccountName"].Column, (string)coll["AccountName"]);
Console.WriteLine("{0} : {1}", coll["AccountPass"].Column, (string)coll["AccountPass"]);
Console.WriteLine("{0} : {1}", coll["AccountBanned"].Column, (byte)coll["AccountBanned"]);
}
Code:
Exception sqlException;
// Deleting "NewAccount"
if ((sqlException = new CoEmu.Database.DBManager("Accounts", CoEmu.Database.DBCommandType.DELETE, connectionString)
.AddWhere("AccountName", System.Data.SqlDbType.VarChar, "NewAccount")
.Execute()) != null)
Console.WriteLine(sqlException.ToString());