using System;
using Conquer_Online_Server.Network;
using Conquer_Online_Server.Database;
using Conquer_Online_Server.Network.AuthPackets;
namespace Conquer_Online_Server
{
class Program
{
public static ServerBase.Counter EntityUID;
public static string GameIP;
public static ushort GamePort;
public static ushort AuthPort;
public static DateTime StartDate;
static void Main(string[] args)
{
try
{
StartDate = DateTime.Now;
Console.Title = "Conquer Online Server Emulator. Start time: " + StartDate.ToString("dd MM yyyy hh:mm");
Console.BackgroundColor = ConsoleColor.Green;
Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine("-- This source has been writen by Bagu Alexandru. --");
Console.WriteLine("-- Copyright (c) Bagu Alexandru 2008-2010. --");
Console.WriteLine("-- Source created with the help of all mighty God.--");
Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("\nLoad server configuration.");
ServerBase.IniFile IniFile = new ServerBase.IniFile("configuration.ini"); IniFile.Read();
GameIP = IniFile.ReadString("Configuration", "IP");
GamePort = IniFile.ReadUInt16("Configuration", "GamePort");
AuthPort = IniFile.ReadUInt16("Configuration", "AuthPort");
Database.ShopFile.Load();
Console.WriteLine("\nInitializing database.");
Database.DMaps.Load();
Database.ConquerItemInformation.LoadInformation();
Database.DataHolder.CreateConnection(IniFile.ReadS tring("MySql", "Username"), IniFile.ReadString("MySql", "Password"), IniFile.ReadString("MySql", "Database"));
Console.WriteLine("\nLoad the character stats.");
Database.DataHolder.ReadStats();
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("conf iguration").Where("Server", ServerBase.Constants.ServerName);
MySqlReader r = new MySqlReader(cmd);
if (r.Read())
{
EntityUID = new ServerBase.Counter(r.ReadUInt32("EntityID"));
Network.GamePackets.ConquerItem.ItemUID = new Conquer_Online_Server.ServerBase.Counter(r.ReadUIn t32("ItemUID"));
}
Line 46 if (EntityUID.Next == 1)
{
Console.WriteLine("Database error. Please check your MySQL. Server will now close.");
Console.ReadLine();
return;
}
that is line 46. Which i why I was confused.
|