Register for your free account! | Forgot your password?

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

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

Advertisement



[Problem] Error with warehouse

Discussion on [Problem] Error with warehouse within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2010
Posts: 13
Received Thanks: 11
[Problem] Error with warehouse

Can anyone explain why i have this error please



Line 679 in Packets.cs

Line 87 in Warehouse.cs

Inside SendWarehouse

Line 638 in PacketHandler.cs

Inside Handle
iLikeSkittles is offline  
Old 09/16/2010, 09:31   #2
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
How did you get that error? Did you fill up the WH all the way?
I didn't look at your code because I'm a bit hand-tied right now but tell me how you got that problem.
-Fáng- is offline  
Old 09/16/2010, 09:45   #3
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Quote:
System.NullReferenceException: Object reference not set to an instance of an object
That's the error, basically what it means is you're trying to send data to something that's just not there. Or at least you didn't tell it what to send data to.

Just skimmed through your code, anyways I think it's because you set warehouse as a null object then try to reassign it.

Why is it null anyways?

Code:
ArrayList Warehouse = null;
In your Inside Warehouse spoiler.
Ian* is offline  
Old 09/16/2010, 10:05   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Code:
ArrayList Warehouse = null;
Should read:

Code:
ArrayList Warehouse = new ArrayList();
Even though the warehouse may remain empty this is correct because it will be an empty arraylist, so Warehouse.Count will return 0.
Korvacs is offline  
Thanks
1 User
Old 09/16/2010, 10:19   #5
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
Quote:
Originally Posted by Korvacs View Post
Code:
ArrayList Warehouse = null;
Should read:

Code:
ArrayList Warehouse = new ArrayList();
Even though the warehouse may remain empty this is correct because it will be an empty arraylist, so Warehouse.Count will return 0.
Sorry =s I just got out of the shower. Good job Korvacs =]
The array list is where the items are stored. Won't do much if it's equal to null xP
-Fáng- is offline  
Old 09/17/2010, 04:35   #6
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
So anyone can fix this problem?
salem rey is offline  
Old 09/17/2010, 04:56   #7
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
Quote:
Originally Posted by salem rey View Post
So anyone can fix this problem?
Korvacs fixed it o.o
The warehouse was being assigned to a null reference instead of an array.
-Fáng- is offline  
Old 09/17/2010, 05:34   #8
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Hang on let me get a spoon...

Code:
 public static COPacket SendWarehouse(Game.Character C, ushort NPC)
        {
[B]            ArrayList Warehouse = null;[/B]
            switch (NPC)
            {
then backspace the word "null".

replace null with "new ArrayList();"
make it look like this, exactly like this.

Code:
 public static COPacket SendWarehouse(Game.Character C, ushort NPC)
        {
[B]            ArrayList Warehouse = new ArrayList();[/B]
            switch (NPC)
            {
Basically what was going wrong was you were trying to use a null value (null basically means there is nothing there).

so instead of making a null array list, you want to create a new array list object to use for each client instance.
Ian* is offline  
Old 09/17/2010, 05:36   #9
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
did he relesae the fix guide? please if it is release give me a link or teach me how? please
salem rey is offline  
Old 09/17/2010, 05:42   #10
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Quote:
Originally Posted by Korvacs View Post
Code:
ArrayList Warehouse = null;
Should read:

Code:
ArrayList Warehouse = new ArrayList();
Even though the warehouse may remain empty this is correct because it will be an empty arraylist, so Warehouse.Count will return 0.
Read this.

Quote:
Originally Posted by Ian* View Post
Hang on let me get a spoon...

Code:
 public static COPacket SendWarehouse(Game.Character C, ushort NPC)
        {
[B]            ArrayList Warehouse = null;[/B]
            switch (NPC)
            {
then backspace the word "null".

replace null with "new ArrayList();"
make it look like this, exactly like this.

Code:
 public static COPacket SendWarehouse(Game.Character C, ushort NPC)
        {
[B]            ArrayList Warehouse = new ArrayList();[/B]
            switch (NPC)
            {
Basically what was going wrong was you were trying to use a null value (null basically means there is nothing there).

so instead of making a null array list, you want to create a new array list object to use for each client instance.
And if you still don't get it read this.

ITS REALLY EASY.... JUST CHANGE ONE WORD AND UR DONE YOU DONT NEED A WHOLE GUIDE TO FIGURE THIS OUT.

kthx
Ian* is offline  
Old 09/17/2010, 05:50   #11
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
i did it but still i got error i see this in my source

In my packet.cs

public static COPacket SendWarehouse(Game.Character C, ushort NPC)
{
ArrayList Warehouse = new ArrayList();
switch (NPC)
{
case 8: { Warehouse = C.Warehouses.TCWarehouse; break; }
case 10012: { Warehouse = C.Warehouses.PCWarehouse; break; }
case 10028: { Warehouse = C.Warehouses.ACWarehouse; break; }
case 10011: { Warehouse = C.Warehouses.DCWarehouse; break; }
case 10027: { Warehouse = C.Warehouses.BIWarehouse; break; }
case 44: { Warehouse = C.Warehouses.MAWarehouse; break; }
case 4101: { Warehouse = C.Warehouses.SCWarehouse; break; }
default: return new COPacket(new byte[0]);
}


In my Warehouse.cs

ArrayList Warehouse = null;
switch (NPC)
{
case 8: { Warehouse = GC.MyChar.Warehouses.TCWarehouse; break; }
case 10012: { Warehouse = GC.MyChar.Warehouses.PCWarehouse; break; }
case 10028: { Warehouse = GC.MyChar.Warehouses.ACWarehouse; break; }
case 10011: { Warehouse = GC.MyChar.Warehouses.DCWarehouse; break; }
case 10027: { Warehouse = GC.MyChar.Warehouses.BIWarehouse; break; }
case 44: { Warehouse = GC.MyChar.Warehouses.MAWarehouse; break; }
case 4101: { Warehouse = GC.MyChar.Warehouses.SCWarehouse; break; }
}
salem rey is offline  
Old 09/17/2010, 06:03   #12
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
If you don't have the error then what's the problem.. you said you want to add a new warehouse. So do it? My friend that can't code can do it ... I don't mean to sound mean... but all you have to do is go to the definitions, copy them, and paste them to make a new Warehouse... and make a new NPC in Stone City and assign it's id to the warehouse...
-Fáng- is offline  
Old 09/17/2010, 06:12   #13
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
i have then i try korvacs fix but still i still facing problem when i open my VIP and click stone city a error pop up in my source, can anyone help me here?


aha i fix it now but the problem is the old accounts cannot log in... you must make new account,.. what is the problem?
salem rey is offline  
Old 09/17/2010, 07:28   #14
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
Quote:
Originally Posted by salem rey View Post
i have then i try korvacs fix but still i still facing problem when i open my VIP and click stone city a error pop up in my source, can anyone help me here?


aha i fix it now but the problem is the old accounts cannot log in... you must make new account,.. what is the problem?
Please read what I said... =[
Korvac's fix isn't for you because you don't have that problem. You're not trying hard enough. Look at the code in front of you. Right click what you don't understand and say "follow to definition" or whatever it is. Please don't just respond with "idk"- say what you tried to do and we might help.
-Fáng- is offline  
Old 09/17/2010, 08:33   #15
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Quote:
Originally Posted by salem rey View Post
i have then i try korvacs fix but still i still facing problem when i open my VIP and click stone city a error pop up in my source, can anyone help me here?


aha i fix it now but the problem is the old accounts cannot log in... you must make new account,.. what is the problem?
Google how to use break points in visual studios.

Set breakpoints within your switch, try depositing an item in your warehouse, see which line the error occurs on, and then let us know exactly where the exception is thrown.
Ian* is offline  
Reply


Similar Threads Similar Threads
[Help] Market Warehouse Problem (5165)
04/30/2010 - CO2 Private Server - 32 Replies
I made it so that the warehouse in the market has 2 pages to it (just like in regular conquer online); however, some of my beta testers disconnect every time they try and access it - even when their characters are newer than the change. http://i746.photobucket.com/albums/xx110/brokentw ilight91/problem2.png They start by being able to access it, then they just ... can't anymore and disconnect every time they try and get into it. ...
Hey, I got a problem with my warehouse password.
11/17/2006 - Conquer Online 2 - 5 Replies
Hey all, I got a character from a friend, but he didnt know the warehouse password nomore.... Since he bought it we cant look up anything.... Does anybody know how too delete/look up that password w/o Conquer Online site or GM ? Please., I really need it cus it is hard too always have an second client online with my internet. I really aint hacker. Thanks in advance.



All times are GMT +2. The time now is 11:54.


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.