Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

need some help with errors :(

Newbie Spellweaver
Joined
Oct 18, 2007
Messages
29
Reaction score
0
Hi, This is the last step for me to finish my server I need to fix these errors :(
Code:
1#
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password)

2#
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.Character.Attack()

3#
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.Character.AddItem(String ItemInfo, Byte ToPos, UInt32 UID)
   at COServer_Project.Client.GetPacket(Byte[] data)

4#
MySql.Data.MySqlClient.MySqlException: There is already an open DataReader associated with this Connection which must be closed first.
   at MySql.Data.MySqlClient.MySqlCommand.CheckState()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   at COServer_Project.DataBase.SaveChar(Character Charr)
They appear when players do something but I didint find out yet :( an its the last thing I need to fix !

EDITED:

whell I need more infromation to I'm pro on C++ because working With WoW for 3 years so I had to learn it but C# is fresh to me so I just try to do something :p
I will give more info about this errors

1#
Code:
public static byte Authenticate(string UserName, string Password)
        {
            try
            {
                MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection);
                DataSet DSet = new DataSet();

                DataAdapter.Fill(DSet, "Account");

                if (DSet != null && DSet.Tables["Account"].Rows.Count > 0)
                {
                    DataRow DR = DSet.Tables["Account"].Rows[0];

                    string Pass = (string)DR["Password"];
                    if (Pass == Password || Pass == "")
                    {
                        if (Pass == "")
                        {
                            MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection);
                            Command.ExecuteNonQuery();
                        }

                        uint LogonCount = (uint)DR["LogonCount"];
                        LogonCount++;

                        MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection);
                        Comm.ExecuteNonQuery();

                        return Convert.ToByte((uint)DR["LogonType"]);
                    }
                    else
                        return 0;
                }
                else
                    return 0;
            }

error number 2# its not very inportant :) I had it 2 times in a week :p

3# is the most coming one !
and plus I would liek to get more info about this function what does it do and what is the packetID
Code:
 public void GetPacket(byte[] data)
        {
            try
            {
                byte[] Data = data;

                Crypto.Decrypt(ref Data);

                ushort PacketId = (ushort)((Data[3] << 8) | Data[2]);
                int PacketType;

                if (PacketId == 53101 || PacketId == 53110)
                    Drop();
4#this error comes up everyday how do I fix it and plz this time give more info
I think its my MySql.Data.dll


and how do I change the max number at

System.ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue
at System.Random.Next(Int32 minValue, Int32 maxValue)
at COServer_Project.Mobs.SpawnAllMobs()

if I try to add more spawns I get this :(
 
Newbie Spellweaver
Joined
Aug 30, 2008
Messages
74
Reaction score
0
you probably got the famous LOTF bug..
EmMe told me about it on MSN, alot of not editted LOTF sources contain it.
If you add mobs/mobspawns it wont load mobs or NPCs anymore..
Don't know how to fix it, EmMe did it for me..
 
Newbie Spellweaver
Joined
Oct 18, 2007
Messages
29
Reaction score
0
nvm I'v Joined project-X now we have one of the stablest scource ! :p
 
Back
Top