SerializeExtraData Item crash...

Reikenz

Member
Apr 5, 2018
64
3
Hello..

I have this bug in my scoreboard wired

I have change ItemBehaviourUtility to SerializeExtraData which is directly integrated into the furni interaction
my problem is for the scoreboard wired i have a crash:

C#:
public void SerializeExtradata(Item Item, ServerPacket Message)
        {
            Message.WriteInteger(Item.LimitedNo > 0 ? 256 : 0);
            Message.WriteString(Item.ExtraData);

            string username;
            string name = Item.GetBaseItem().ItemName;
            string type = name.Split('*')[1];

            if (type != null)
            {
                Dictionary<int, KeyValuePair<int, string>> ScoreBordata = new Dictionary<int, KeyValuePair<int, string>>();
                Message.WriteInteger(0);
                Message.WriteInteger(6);
                Message.WriteString("1");
                Message.WriteInteger(1);

                if (Item.GetRoom() != null)
                {
                    switch (type)
                    {
                        case "2":
                            Message.WriteInteger(1);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordDay.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordDay;
                            break;

                        case "3":
                            Message.WriteInteger(2);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordWeek.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordWeek;
                            break;


                        case "4":
                            Message.WriteInteger(3);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordMonth.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordMonth;
                            break;

                        default:
                            Message.WriteInteger(1);
                            Message.WriteInteger(0);
                            ScoreBordata = null;
                            break;
                    }
                }
                else
                {
                    Message.WriteInteger(1);
                    Message.WriteInteger(1);
                    Message.WriteInteger(0);
                    Message.WriteInteger(1);
                    Message.WriteString("Ce tableau de score ne fonctionne pas encore :(");
                }

                if (ScoreBordata.Count != 0)
                {
                    foreach (KeyValuePair<int, string> value in (
                        from i in ScoreBordata
                        orderby i.Value.Key descending
                        select i).ToDictionary<KeyValuePair<int, KeyValuePair<int, string>>, int, KeyValuePair<int, string>>((KeyValuePair<int, KeyValuePair<int, string>> i) => i.Key, (KeyValuePair<int, KeyValuePair<int, string>> i) => i.Value).Values)
                    {
                        username = value.Value;
                        Message.WriteInteger(value.Key);
                        Message.WriteInteger(1);
                        Message.WriteString((string.IsNullOrEmpty(username) ? string.Empty : username));
                    }
                }
            }
        }

Can someone help me for this bug please?
 

treebeard

Member
Jan 16, 2018
317
173
Hello..

I have this bug in my scoreboard wired

I have change ItemBehaviourUtility to SerializeExtraData which is directly integrated into the furni interaction
my problem is for the scoreboard wired i have a crash:

C#:
public void SerializeExtradata(Item Item, ServerPacket Message)
        {
            Message.WriteInteger(Item.LimitedNo > 0 ? 256 : 0);
            Message.WriteString(Item.ExtraData);

            string username;
            string name = Item.GetBaseItem().ItemName;
            string type = name.Split('*')[1];

            if (type != null)
            {
                Dictionary<int, KeyValuePair<int, string>> ScoreBordata = new Dictionary<int, KeyValuePair<int, string>>();
                Message.WriteInteger(0);
                Message.WriteInteger(6);
                Message.WriteString("1");
                Message.WriteInteger(1);

                if (Item.GetRoom() != null)
                {
                    switch (type)
                    {
                        case "2":
                            Message.WriteInteger(1);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordDay.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordDay;
                            break;

                        case "3":
                            Message.WriteInteger(2);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordWeek.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordWeek;
                            break;


                        case "4":
                            Message.WriteInteger(3);
                            Message.WriteInteger(Item.GetRoom().WiredScoreBordMonth.Count);
                            ScoreBordata = Item.GetRoom().WiredScoreBordMonth;
                            break;

                        default:
                            Message.WriteInteger(1);
                            Message.WriteInteger(0);
                            ScoreBordata = null;
                            break;
                    }
                }
                else
                {
                    Message.WriteInteger(1);
                    Message.WriteInteger(1);
                    Message.WriteInteger(0);
                    Message.WriteInteger(1);
                    Message.WriteString("Ce tableau de score ne fonctionne pas encore :(");
                }

                if (ScoreBordata.Count != 0)
                {
                    foreach (KeyValuePair<int, string> value in (
                        from i in ScoreBordata
                        orderby i.Value.Key descending
                        select i).ToDictionary<KeyValuePair<int, KeyValuePair<int, string>>, int, KeyValuePair<int, string>>((KeyValuePair<int, KeyValuePair<int, string>> i) => i.Key, (KeyValuePair<int, KeyValuePair<int, string>> i) => i.Value).Values)
                    {
                        username = value.Value;
                        Message.WriteInteger(value.Key);
                        Message.WriteInteger(1);
                        Message.WriteString((string.IsNullOrEmpty(username) ? string.Empty : username));
                    }
                }
            }
        }

Can someone help me for this bug please?
Posting the error or stacktrace etc would be helpful.

Not many will take the time to recreate the error but if you post the error message you may get help much faster.
 

treebeard

Member
Jan 16, 2018
317
173
I did not put it because I have no error log
I forget where Plus logs errors but somewhere in the file hierarchy there should be a log of server errors.

If it's crashing with no error (kek) then try setting breakpoints or debugging to pinpoint the exact line causing the crash.

It's hard to help in such a limited scope especially if this is a runtime error.
 

treebeard

Member
Jan 16, 2018
317
173
Yes there is an error log but it is empty and my emulator and run in debug mode but nothing at all
I would highly suggest using breakpoints, the debuggers options to step in and out of functions, or worst case scenario print out to stdout to see where your application crashes.

If these are unfamiliar concepts, I would highly suggest some Googling about debugging and troubleshooting.

I'm personally not going to set up an environment for Plus just to do it myself. I'm more than happy to help though!
 

Reikenz

Member
Apr 5, 2018
64
3
my emulator crash if item have interaction type wired_scorebord which corresponds to the code aboveand that the item and in my inventory or in the apartment if it is in the inventory I can not open it without crash anymore
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Sounds like a possible packet structure issue if no exception is logging.

Have you checked the console to see if the client has outputted an error? I believe in newer versions it sends POST request to /client/error, you can view the body there and if there is a packet issue, it'll tell you what it is there.
 

Reikenz

Member
Apr 5, 2018
64
3
Sounds like a possible packet structure issue if no exception is logging.

Have you checked the console to see if the client has outputted an error? I believe in newer versions it sends POST request to /client/error, you can view the body there and if there is a packet issue, it'll tell you what it is there.
Would you like to fix wireds scoreboard under PRODUCTION-201802201205-141713395 that's what I'm trying to fix

I have the fixed but for a prod of 2016 and I assume that structures have changed since I can pay of course ^^ '

Otherwise I did not really understand what you said
 

Users who are viewing this thread

Top