Register for your free account! | Forgot your password?

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

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

Advertisement



[Help] Impulse Source Nobility Error.

Discussion on [Help] Impulse Source Nobility Error. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
[Help] Impulse Source Nobility Error.

Hey guys I'm finally back and staying.

I've decided to learn the ropes of coding step by step so I took out a fresh copy of the impulse source and began coding on it(just recently). I coded nobility(parts from another reference), but the MySqlReader is giving me problems while I load up the console.

These are my variables at the top:
Code:
private DataSet _dataset;
        private DataRow _datarow;
        private int _row;
        const string Table = "table";
I fixed the NullException error for the Void Read() by replacing it with this:
Code:
public bool Read()
        {
            if (_dataset != null && _dataset.Tables[Table].Rows.Count > _row)
            {
                _datarow = _dataset.Tables[Table].Rows[_row];
                _row++;
                return true;
            }
            _row++;
            return false;
        }
don't know if it was a useful change but it worked(I guess).

I get an error now saying:
Quote:
Object Reference not set to an instance of an Object.
Line 24 NobilityTable.cs is this:
Code:
reader.Close();
which is part of this:
Code:
public static void Load()
        {
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("nobility");
            MySqlReader reader = new MySqlReader(cmd);
            while (reader.Read())
            {
                Game.ConquerStructures.NobilityInformation nobilityinfo = new Conquer_Online_Server.Game.ConquerStructures.NobilityInformation();
                nobilityinfo.EntityUID = reader.ReadUInt32("EntityUID");
                nobilityinfo.Name = reader.ReadString("EntityName");
                nobilityinfo.Donation = reader.ReadUInt64("Donation");
                nobilityinfo.Gender = reader.ReadByte("Gender");
                nobilityinfo.Mesh = reader.ReadUInt32("Mesh");
                Game.ConquerStructures.Nobility.Board.Add(nobilityinfo.EntityUID, nobilityinfo);
            }
            reader.Close();
            Game.ConquerStructures.Nobility.Sort(0);
            Console.WriteLine("Nobility information loaded.");
        }
And this is the Void Close():
Code:
public void Close()
        {
            _dataset.Clear();
        }
From there on I'm a little stuck.

I would appreciate a little help pointing me in the right direction, sorry for my "newb-ness" but I wanted to know what is causing this and why.

Regards, killersub.
killersub is offline  
Old 09/12/2012, 11:36   #2
 
checker345's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 50
Received Thanks: 4
Free Bump!
checker345 is offline  
Old 09/13/2012, 00:01   #3
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Looks like _dataset in your Close void is null.
.Kinshi is offline  
Old 09/13/2012, 01:09   #4
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by .Kinshi View Post
Looks like _dataset in your Close void is null.
I did breakpoint it and it told me _dataset was in fact null.

the problem is that when I assign it as a new variable it still tells me it's null.

Example:
Code:
private DataSet _dataset = new DataSet();
it still tells me it's null.

Sorry for my low level of understanding but I need a little help as to what the problem is.
killersub is offline  
Old 09/13/2012, 02:41   #5
 
elite*gold: 0
Join Date: Sep 2012
Posts: 43
Received Thanks: 12
Welcome back,
Maybe this might help?

Read the comments

Also press this link(everyone):
Purple<3 is offline  
Thanks
3 Users
Old 09/13/2012, 10:11   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
If your learning to code step by step, why are you starting working on someone else's source?

Start fresh and actually learn step by step how to put together a project and over come the challenges you face as you go.
Korvacs is offline  
Thanks
2 Users
Old 09/13/2012, 12:20   #7
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Quote:
Originally Posted by Purple<3 View Post
Welcome back,
Maybe this might help?

Read the comments

Also press this link(everyone):
You know each thanks you give has a unique securityToken? That link will only work for you.
_DreadNought_ is offline  
Thanks
1 User
Old 09/13/2012, 18:34   #8
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by Korvacs View Post
If your learning to code step by step, why are you starting working on someone else's source?

Start fresh and actually learn step by step how to put together a project and over come the challenges you face as you go.
Because I simply can not put myself to that test at the moment.

My IRL problems and duties are too much of a hassle for me to actually concentrate on C# "step by step"(what I meant by that was to start off with a fresh source that is feature-less(or so to speak) and work my way up slowly).
killersub is offline  
Old 09/14/2012, 03:45   #9
 
elite*gold: 0
Join Date: Sep 2012
Posts: 43
Received Thanks: 12
Quote:
Originally Posted by _DreadNought_ View Post
You know each thanks you give has a unique securityToken? That link will only work for you.
ik
Purple<3 is offline  
Reply


Similar Threads Similar Threads
Nobility Impulse 5165
09/12/2012 - CO2 Private Server - 17 Replies
I started working on Impulse 5165, first thing I did was to add Nobility, but the icon won't appear in the screen. The table was loaded, and I'm calling ( don't know, what term shall I use -.-) the nobility during log in. What I am missing? Does the Nobility on higher version work on 5165? Edit: I was checking on my previous threads, and I have decided to update it to remind myself of what I accomplished 2 years ago. I have fixed the Nobility, it was just an offset that needed to...
Problem in my source updated to version 5620+ *Impulse Source*
08/15/2012 - CO2 Private Server - 11 Replies
I updated my source to version 5620+ 1) I open my account with any password. 2) Can I log into an account without having a registered account. 3) I cannot see the monsters or other players Any help or hint is welcome.....
Source impulse 5375 error
05/14/2011 - CO2 Private Server - 4 Replies
hello I'm here to ask for a help! I use the server's impulse 5375, he is running normally, so that sometimes it's an error, Error: Disconnected with game server. Please login the game again! . So nobody else can log on! Some days it does not occur, most of the day that has up to 10 times this error! So I have to restart the server to work again! In the source does not appear any error. could someone help me fix? or else some command to restart the gameserver and authserv without...
i need help in source Conquer Online Source (impulse)
03/01/2011 - CO2 Private Server - 4 Replies
Originally Posted by FuriousFang Don't double post... We told you, you're not setting up the config and entities right. Look, copy mine: Configuration Table: EntityID: 1000001 ItemUID: 1000001 Server: TestServer (Make sure it matches what you have in the source) Accounts Table:



All times are GMT +1. The time now is 00:58.


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.