I don't want spoonfeeding

05/01/2020 23:11 denominator#1
Like I said I don't want spoonfeeding but I'd like to know if I should be searching in GameState, PacketHandler, Program or ClientWrapper

Code:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Desco_Pj.Client.GameState.get_ChampionPoints() in C:\SourceNightMareV1\SourceNightMareV1\Client\GameState.cs:line 2454
   at Desco_Pj.Network.PacketHandler.UseItem(ConquerItem item, GameState client) in C:\SourceNightMareV1\SourceNightMareV1\Network\PacketHandler.cs:line 15860
   at Desco_Pj.Network.PacketHandler.EquipItem(ItemUsage itemUsage, GameState client) in C:\SourceNightMareV1\SourceNightMareV1\Network\PacketHandler.cs:line 21889
   at Desco_Pj.Network.PacketHandler.HandlePacket(Byte[] packet, GameState client) in C:\SourceNightMareV1\SourceNightMareV1\Network\PacketHandler.cs:line 1831
   at Desco_Pj.Program.processData(Byte[] buffer, Int32 length, GameState Client) in C:\SourceNightMareV1\SourceNightMareV1\Program.cs:line 1272
   at Desco_Pj.Program.GameServer_OnClientReceive(Byte[] buffer, Int32 length, ClientWrapper obj) in C:\SourceNightMareV1\SourceNightMareV1\Program.cs:line 1255
   at Desco_Pj.Network.Sockets.ClientWrapper.doReceive(Int32 available) in C:\SourceNightMareV1\SourceNightMareV1\Network\Sockets\ClientWrapper.cs:line 130
I'm attempting to add code so that I can use ChiToken and that's what the console gave me when I tried to use it, just want to know which area I should be searching
05/01/2020 23:24 Spirited#2
It says exactly where you should be searching in that error. It includes the full stack trace of what line caused the issue and all calls that came before it. It also includes an error name and a full description of what the error means. This isn't the first time you've done this either... so tell me. Can you answer the following questions?

1. What is the name of the error?
2. What is the description of that error and what does that mean?
3. What line and file did the error occur in?
4. What is the parent method? What can you say the server was doing when the error occurred?
05/01/2020 23:34 denominator#3
Going to hazard a guess that it's reference not set to an instance of an object on line 2454 of GameState.cs? Going to guess it's something set to null?

Not really sure what the parent method is though, I'll be checking it tomorrow after I have got some needed sleep :/

Server was running normally I had built it and wasn't actually debugging it, just wanted to see if I had it working or not lol
05/02/2020 00:46 Yupmoh#4
Please stop with the shitty posts and stupid questions, read a book on programming or find a tutorial online it's much better for you, you'll understand how stupid what you're doing is when you actually learn how to program.

EDIT: Look man, I don't wanna be a dick about it, but you're spamming the forums with terrible questions that don't even require any external inputs to help you get to the bottom of it. Honestly direct message me and I'll recommend a book or a tutorial or something to save you from your misery.
05/02/2020 04:19 Spirited#5
Quote:
Originally Posted by denominator View Post
Going to hazard a guess that it's reference not set to an instance of an object on line 2454 of GameState.cs? Going to guess it's something set to null?

Not really sure what the parent method is though, I'll be checking it tomorrow after I have got some needed sleep :/

Server was running normally I had built it and wasn't actually debugging it, just wanted to see if I had it working or not lol
Well, on the next line directly below where you found the root of the problem (GameState.cs at line 2454), what does it say?
05/02/2020 12:23 denominator#6
Quote:
Originally Posted by Spirited View Post
Well, on the next line directly below where you found the root of the problem (GameState.cs at line 2454), what does it say?
at Desco_Pj.Network.PacketHandler.UseItem(ConquerItem item, GameState client) in C:\SourceNightMareV1\SourceNightMareV1\Network\Pac ketHandler.cs:line 15860?
05/02/2020 18:27 Spirited#7
Quote:
Originally Posted by denominator View Post
at Desco_Pj.Network.PacketHandler.UseItem(ConquerItem item, GameState client) in C:\SourceNightMareV1\SourceNightMareV1\Network\Pac ketHandler.cs:line 15860?
Right, so that tells you that it tried to consume an item, and something that it passed into your GameState was null or something in the GameState itself was null. So now, take a look at the GameState and see what that line is that threw the exception and what variables it uses that could be null / uninitialized.
05/02/2020 19:57 denominator#8
So then it must be something to do with this

Code:
public uint ChampionPoints
        {
            get
            {
                return CP.Points;
            }
            set
            {
                uint old = CP.Points;
                if (CP.TodayPoints < value)
                    CP.TodayPoints = value;
                if (CP.TodayPoints > 650)
                {
                    CP.TodayPoints = 650;
                    if (Entity.FullyLoaded)
                        Send(new Message("Your Champion Points have reached the max amount of 650 points. You can collect more points tommorrow.", Color.Red, Message.System));
                }
                else
                {
                    CP.Points =   <---Probably this part
                   value;
                    if (old < ChampionPoints)
                        CP.AllChampionPoints += (ChampionPoints - old);
                    if (Entity.FullyLoaded && old < ChampionPoints)
                        Send(new Message("You received " + (ChampionPoints - old) + " Champion Points!", Color.Red, Message.System));
                }
                if (Entity.LoadedActivenessSystem)
                {
                    Activenes.SendSinglePacket(this, Activeness.Types.ChampionPTask, 1);
                }
            }
        }
05/02/2020 20:06 Spirited#9
And what's the set property definition for CP.Points?
05/02/2020 20:56 denominator#10
You've lost me lol unless you mean this

Code:
public Network.GamePackets.ChampionPoints CP;
Currently reading [Only registered and activated users can see links. Click Here To Register...] just to try to get a better understanding of it all