Impulse 5165 Source Error

12/09/2017 23:27 killerdiggs#1
I just started back up coding and wanted to work with Impulse's source but when I went to start it up again today i received an error I am not familiar with.

Load the character stats.
System.NullReferenceException: Object reference not set to an instance of an object.
at Conquer_OnlineServer.Program.Main(String[] args) in D:\Entertainment\DropBox\COServer 5165\Conquer_Online_Server\Program.cs: line 46

Any help would be much appreciated.
12/09/2017 23:39 Spirited#2
Quote:
Originally Posted by killerdiggs View Post
I just started back up coding and wanted to work with Impulse's source but when I went to start it up again today i received an error I am not familiar with.

Load the character stats.
System.NullReferenceException: Object reference not set to an instance of an object.
at Conquer_OnlineServer.Program.Main(String[] args) in D:\Entertainment\DropBox\COServer 5165\Conquer_Online_Server\Program.cs: line 46

Any help would be much appreciated.
Well, it's as it says in the error. Null reference. Object was not set.
It even tells you what line it was on... which you were kind enough not to supply us with...
12/12/2017 04:49 killerdiggs#3
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.
12/12/2017 05:14 Spirited#4
As it says on page 2 and 3 of that thread, database error. You didn't configure MySQL correctly, and the source isn't written correctly to handle that error, hens the null exception.