Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 06:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP] Please help me understand this error

Discussion on [HELP] Please help me understand this error within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
[HELP] Please help me understand this error

Code:
[COLOR=#000000]System.NullReferenceExeption: Object reference no set to an instance of an object. at COServerProject.Client.GetPacket(Byte[] data) in c:\***\client.cs:line 7785[/COLOR]
I need specifics. All my reading has told me is that this error occurs when a string is not null. Knowing the quick fix would be nice, but understanding the error would pwn.

Thanks in advance for your helpful replies.
taguro is offline  
Old 09/03/2008, 21:23   #2
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Paste the getpacket function too, lol.
InfamousNoone is offline  
Thanks
1 User
Old 09/03/2008, 22:37   #3
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by InfamousNoone View Post
Paste the getpacket function too, lol.
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.Client.GetPacket(Byte[] data) in C:xxxClient.cs:line 7785
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
I'm not sure if this is what your looking for, but this is the whole error report from my serverlog. If you need more info, add me on msn:

and thanks for the quick response.
taguro is offline  
Old 09/03/2008, 22:41   #4
 
MushyPeas's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 800
Received Thanks: 89
Quote:
Originally Posted by taguro View Post
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.Client.GetPacket(Byte[] data) in C:xxxClient.cs:line 7785
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
I'm not sure if this is what your looking for, but this is the whole error report from my serverlog. If you need more info, add me on msn:

and thanks for the quick response.
He means he has to see the code (the function) that is causing the errors, otherwise he can't possibly guess what needs to be fixed.
MushyPeas is offline  
Thanks
1 User
Old 09/03/2008, 22:45   #5
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Quote:
Originally Posted by taguro View Post
Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.Client.GetPacket(Byte[] data) in C:xxxClient.cs:line 7785
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
System.NullReferenceException: Object reference not set to an instance of an object.
   at COServer_Project.DataBase.Authenticate(String UserName, String Password) in C:xxxDataBase.cs:line 1709
I'm not sure if this is what your looking for, but this is the whole error report from my serverlog. If you need more info, add me on msn:

and thanks for the quick response.
lol?Hybrid was saying something like:
go to line 7785 from client.cs and post here the line....
alexbigfoot is offline  
Thanks
1 User
Old 09/03/2008, 23:13   #6
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by alexbigfoot View Post
lol?Hybrid was saying something like:
go to line 7785 from client.cs and post here the line....
Crap, sorry dumb moment. Here you are: (Client.cs statement)

Code:
  if (Control <= 16 && Control >= 10)
                                {
                                    string TheEquip = "";

                                    if (Control == 10)
                                        TheEquip = MyChar.Equips[1];
                                    if (Control == 11)
                                        TheEquip = MyChar.Equips[2];
                                    if (Control == 12)
                                        TheEquip = MyChar.Equips[3];
                                    if (Control == 13)
                                        TheEquip = MyChar.Equips[4];
                                    if (Control == 14)
                                        TheEquip = MyChar.Equips[6];
                                    if (Control == 15)
                                        TheEquip = MyChar.Equips[8];
                                    if (Control == 16)
                                        TheEquip = MyChar.Equips[5];

                                    byte Pos = 0;

                                    if (Control == 10)
                                        Pos = 1;
                                    if (Control == 11)
                                        Pos = 2;
                                    if (Control == 12)
                                        Pos = 3;
                                    if (Control == 13)
                                        Pos = 4;
                                    if (Control == 14)
                                        Pos = 6;
                                    if (Control == 15)
                                        Pos = 8;
                                    if (Control == 16)
                                        Pos = 5;

                                    string[] Splitter = TheEquip.Split('-');
                                    uint ItemId = uint.Parse(Splitter[0]);

                                    if (!Other.Upgradable(ItemId))
                                        return;

                                    byte RequiredMets = 0;
                                    if (Other.ItemInfo(ItemId)[3] < 120)
                                    {
                                        RequiredMets = (byte)(Other.ItemInfo(ItemId)[3] / 10);
                                        if (RequiredMets == 0)
                                            RequiredMets = 1;
                                    }
                                    if (RequiredMets != 0)
                                    {
                                        if (Other.ItemQuality(ItemId) < 7)
                                            RequiredMets = 2;
                                        if (Other.ItemQuality(ItemId) == 7)
                                            RequiredMets = (byte)(2 + RequiredMets / 5);
                                        if (Other.ItemQuality(ItemId) == 8)
                                            RequiredMets = (byte)(RequiredMets * 2.6);
                                        if (Other.ItemQuality(ItemId) == 9)
                                            RequiredMets = (byte)(RequiredMets * 3.1);
                                    }
Here is the specific line(7785):
Code:
                                    string[] Splitter = TheEquip.Split('-');
And here is the Database.cs statement:
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)
                //if (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;
            }
            catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }
        }
and line 1709:
Code:
                DataSet DSet = new DataSet();
taguro is offline  
Old 09/03/2008, 23:39   #7
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Quote:
Originally Posted by taguro View Post
Crap, sorry dumb moment. Here you are: (Client.cs statement)

Code:
  if (Control <= 16 && Control >= 10)
                                {
                                    string TheEquip = "";

                                    if (Control == 10)
                                        TheEquip = MyChar.Equips[1];
                                    if (Control == 11)
                                        TheEquip = MyChar.Equips[2];
                                    if (Control == 12)
                                        TheEquip = MyChar.Equips[3];
                                    if (Control == 13)
                                        TheEquip = MyChar.Equips[4];
                                    if (Control == 14)
                                        TheEquip = MyChar.Equips[6];
                                    if (Control == 15)
                                        TheEquip = MyChar.Equips[8];
                                    if (Control == 16)
                                        TheEquip = MyChar.Equips[5];

                                    byte Pos = 0;

                                    if (Control == 10)
                                        Pos = 1;
                                    if (Control == 11)
                                        Pos = 2;
                                    if (Control == 12)
                                        Pos = 3;
                                    if (Control == 13)
                                        Pos = 4;
                                    if (Control == 14)
                                        Pos = 6;
                                    if (Control == 15)
                                        Pos = 8;
                                    if (Control == 16)
                                        Pos = 5;

                                    if (TheEquip != null) // ADD THIS
                                    { // ADD THIS
                                    string[] Splitter = TheEquip.Split('-');
                                    uint ItemId = uint.Parse(Splitter[0]);

                                    if (!Other.Upgradable(ItemId))
                                        return;

                                    byte RequiredMets = 0;
                                    if (Other.ItemInfo(ItemId)[3] < 120)
                                    {
                                        RequiredMets = (byte)(Other.ItemInfo(ItemId)[3] / 10);
                                        if (RequiredMets == 0)
                                            RequiredMets = 1;
                                    }
                                    if (RequiredMets != 0)
                                    {
                                        if (Other.ItemQuality(ItemId) < 7)
                                            RequiredMets = 2;
                                        if (Other.ItemQuality(ItemId) == 7)
                                            RequiredMets = (byte)(2 + RequiredMets / 5);
                                        if (Other.ItemQuality(ItemId) == 8)
                                            RequiredMets = (byte)(RequiredMets * 2.6);
                                        if (Other.ItemQuality(ItemId) == 9)
                                            RequiredMets = (byte)(RequiredMets * 3.1);
                                    }
                                    } // ADD THIS
Here is the specific line(7785):
Code:
                                    string[] Splitter = TheEquip.Split('-');
And here is the Database.cs statement:
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)
                //if (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;
            }
            catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }
        }
and line 1709:
Code:
                DataSet DSet = new DataSet();
You can fix the indent, or the compiler will lol; tanel did such a shit job on lotf I'm not bothering to optimize the code.
InfamousNoone is offline  
Thanks
1 User
Old 09/03/2008, 23:54   #8
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by InfamousNoone View Post
You can fix the indent, or the compiler will lol; tanel did such a **** job on lotf I'm not bothering to optimize the code.
I appreciate you taking the time to look this over, but what does the indent have to do with the error I'm receiving.
taguro is offline  
Old 09/04/2008, 00:27   #9
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
The string "TheEquip" is null, and it's trying to split it.
InfamousNoone is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Help Me to Understand
08/27/2009 - Archlord - 1 Replies
hi,i need someone to help me made good build for archer,i mean good for PVE and PVP,and i have some question if someone knows plz help me to find out what is this Word Mean and what diffrent between them,u know what diffrent between Defense and block and resistance so if some one know plz described for me 1.Discipline 2.Defense 3.Attack Rating 4.Block 1.STA 2.WIS 3.AGI 4.STR 5.INT 6.CHA 1.Damage 2.A.speed 3.M.speed 4.A.rating 5.D.Rating 6.Accuracy 7.Dodge 8.Range 9.lgn.E.Resistance...
I don't understand ...
04/01/2008 - Eudemons Online - 2 Replies
I don't understand ... although I made not one, but two different new accounts, when I start the game, I keep receiving a message "The server is down". What's wrong?
Why i cant understand nothing?
05/17/2007 - Silkroad Online - 3 Replies
Look at these Ip's and if someone can answer me its ok I deleted just my country's ip www.bot258.com IP Route ================================================= == === VisualRoute report on 17-May-07 3:42:05 AM === ================================================= ==
cannot understand how they ban us
05/08/2007 - Silkroad Online - 9 Replies
well guys any1 saw the huge bot list... my question is: how they ban us? 1- gms come in game and wisp us to see if wer repsonding or not? 2-softmod can be detected... truly sad :cry: P.S= don't take it bad im not a noobish... im just wodering



All times are GMT +1. The time now is 06:12.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.