Register for your free account! | Forgot your password?

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

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

Advertisement



Annoying Unknown Error

Discussion on Annoying Unknown 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
Annoying Unknown Error

Alright sorry for my massive posting but I have been testing out different sources amd understand how they are coded, a little better. I just need this one to figure out InGame how everything works but ofc I get errors.

I get an error on the 'public static void Load(GameClient GC)'

Here's the line of the error:

Code:
if (DateTime.Now > GC.MyChar.canload.AddSeconds(3) && GC.MyChar.cannload == false)
This is the error:

Code:
Object reference not set to an instance of an object
This is the first ProjectX source originally released here, that I'm currently using btw.

EDIT:
Now at times it wont give me any error now the client closes halfway loading without any error.
killersub is offline  
Old 10/10/2011, 03:02   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
The error is very general. It's saying that an object has not been set to any value.


For example if I told you "is player X over level 130" you can't check that if I haven't given you the information about who player x is.


Breakpoint it, check the line where the error is happening and find what is null then make sure you assign it before checking it.
pro4never is offline  
Old 10/10/2011, 03:29   #3
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by pro4never View Post
The error is very general. It's saying that an object has not been set to any value.


For example if I told you "is player X over level 130" you can't check that if I haven't given you the information about who player x is.


Breakpoint it, check the line where the error is happening and find what is null then make sure you assign it before checking it.
I wouldn't have posted if I haven't tried all of that,sir.

The result is inevitable, client comes to a stop then closes rapidly.

The breakpoint did not help me because I got nothing out of it, btw the values is assigned to a 'new DateTime()' so that can't be it.

There must be some sort of hidden error, idk.
killersub is offline  
Old 10/10/2011, 04:08   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
GC is not null, mychar is not null and canload is a valid, initiated datetime value?
pro4never is offline  
Old 10/10/2011, 07:21   #5
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
canload is null if I'm correct. Initialize it in the constructor of the character class.
BaussHacker is offline  
Old 10/10/2011, 16:46   #6
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by pro4never View Post
GC is not null, mychar is not null and canload is a valid, initiated datetime value?
Correct everything is assigned to a value. But for some reason it tells me GC in the parameters of the 'Load' void is null, when it cant be because it's the ClientState and it can't ne null ?

Quote:
Originally Posted by BaussHacker View Post
canload is null if I'm correct. Initialize it in the constructor of the character class.
sorry I'm still kinda new to some of this.

'public bool canload == false'

Has a value assigned to it already, has it not?
killersub is offline  
Old 10/10/2011, 17:59   #7
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
canload must be null.
also, == is a Boolean expression.
= is an assignment.

Spirited is offline  
Old 10/10/2011, 19:08   #8
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Argh, I don't have the source. Haven't got it since I released it, I will download it and take a look and get back to you
BaussHacker is offline  
Old 10/11/2011, 00:34   #9
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by Fаng View Post
canload must be null.
also, == is a Boolean expression.
= is an assignment.

Sorry to break it to you sir, But I already have the basic knowledge to know the difference between "==" and "=".

this is "CANLOAD":
Code:
public DateTime canload = new DateTime();
this is "CANNLOAD":
Code:
public bool cannload = false;
Quote:
Originally Posted by BaussHacker View Post
Argh, I don't have the source. Haven't got it since I released it, I will download it and take a look and get back to you
I would so much appreciate it.

Any questions you have, please ask ahead.
killersub is offline  
Old 10/11/2011, 00:44   #10
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Before I look at it try change:
public DateTime canload = new DateTime();

to:
public DateTime canload = DateTime.Now;


You can also try catching ArgumentNullException or what it's named.
BaussHacker is offline  
Old 10/11/2011, 03:36   #11
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by BaussHacker View Post
Before I look at it try change:
public DateTime canload = new DateTime();

to:
public DateTime canload = DateTime.Now;


You can also try catching ArgumentNullException or what it's named.
Will do.

will get back to you ASAP.

EDIT:

The error seems to occur when the client finishes creating the Account and the server sends the "Load" void to the client, that it when the
Quote:
Object reference not set to an instance of an object
error pops up in the same line. And when I try to login again the client crashes.
killersub is offline  
Old 10/11/2011, 12:39   #12
 
pwerty's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 55
Received Thanks: 11
breakpoint. Check for null values in Client/entity
pwerty is offline  
Old 10/11/2011, 12:57   #13
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Replace it with:
Code:
        public static void Load(Character C)
        {
            if (C.cannload == true)
            {
                if (DateTime.Now > C.canload.AddSeconds(3))
                {
                    C.CanBackup = DateTime.Now;

                    C.Loc.PreviousMap = 1002;
                    C.Loc.PreviousX = 400;
                    C.Loc.PreviousY = 400;

                    C.cannload = false;
                    C.CTT.Stop();
                    C.IsLoaded = true;
                    C.Teleport(C.Loc.Map, C.Loc.X, C.Loc.Y);
                }
            }
        }
Find the constructor for Character and replace it with:
Code:
            CTT = new System.Timers.Timer(5000.0);
            CTT.Start();
            CTT.Elapsed += delegate { Timer32.Timer.Load(this); };
Now find C.Loaded = true; in (Database.cs)
Code:
public static Game.Character LoadCharacter(string Name, ref string Account)
Put this under:
Code:
C.cannload = true;
Really bad way, but it should work. I can see a lot other **** mistakes I made back then and something like this should not even be in use.
BaussHacker is offline  
Thanks
1 User
Old 10/11/2011, 20:59   #14
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by BaussHacker View Post
Replace it with:
Code:
        public static void Load(Character C)
        {
            if (C.cannload == true)
            {
                if (DateTime.Now > C.canload.AddSeconds(3))
                {
                    C.CanBackup = DateTime.Now;

                    C.Loc.PreviousMap = 1002;
                    C.Loc.PreviousX = 400;
                    C.Loc.PreviousY = 400;

                    C.cannload = false;
                    C.CTT.Stop();
                    C.IsLoaded = true;
                    C.Teleport(C.Loc.Map, C.Loc.X, C.Loc.Y);
                }
            }
        }
Find the constructor for Character and replace it with:
Code:
            CTT = new System.Timers.Timer(5000.0);
            CTT.Start();
            CTT.Elapsed += delegate { Timer32.Timer.Load(this); };
Now find C.Loaded = true; in (Database.cs)
Code:
public static Game.Character LoadCharacter(string Name, ref string Account)
Put this under:
Code:
C.cannload = true;
Really bad way, but it should work. I can see a lot other shit mistakes I made back then and something like this should not even be in use.
smart fix, but still there is an error.

Quote:
Object reference not set to an instance of an object
Error line (Character.cs) "TELEPORT VOID"

Code:
MyClient.AddSend(Packets.GeneralData(EntityID, Map, X, Y, 86));
killersub is offline  
Old 10/11/2011, 21:14   #15
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Might be Loc or Map that's empty.

Could be MyClient as well.
BaussHacker is offline  
Reply


Similar Threads Similar Threads
[Help] Annoying 5095 Error
06/20/2011 - CO2 Private Server - 2 Replies
okay so I have been fiddling around with Elite-CoEmu but found out I couldn't get it to run like I usually did before. this time It gave me more errors than before. Errors in WorldServer: 21:0 - == Welcome to Elite-CoEmu v5095 == 21:0 - == This Program is for Non Profitable and Entertainment Purposes Only == 21:0 - Starting to Initialize 21:0 - Loaded PMap 601 21:0 - Loaded PMap 700 21:0 - Loaded PMap 1000
{HELP} Annoying 5095 Error!
11/08/2010 - CO2 Private Server - 0 Replies
okay so this error is starting to piss me off(I have barely modified the source and this already starts to happen...) since I cannot start the server because of it...it is the all-known error: The type initializer for 'CoEmu_v2_GameServer.Nano' threw an exception. And I highly doubt that it's the startserver void thats causing da problem... I really would love some help on this error since I can't seem to find good help around lately :S...I don't think u can modify a 5095 source...
annoying error
10/29/2009 - Silkroad Online - 4 Replies
i got one error that kick me from game every 30 min there is a photo: http://www.elitepvpers.com/forum/picture.php?album id=1104&pictureid=3326
Annoying error.
01/29/2009 - Dekaron Private Server - 0 Replies
I've formatted and re-installed all the correct required things needed. And configured all my settings as it was before I formatted (Yes my server worked before I had formatted using the same MSSQL) I've even done the ODBC and SN correctly, and yet I get this error. http://anonymouse.org/cgi-bin/anon-www.cgi/http:/ /demonicbots.freehostia.com/error.PNG Can anyone help me fix this error?
Annoying error with Dsremu
09/20/2008 - SRO Private Server - 3 Replies
Hi when i click on my char and load it i get this error --------------------------- prjVBEmu --------------------------- Run-time error '6': Overflow --------------------------- OK



All times are GMT +2. The time now is 09:57.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.