PollContentsComposer?

j’aime ma famille
Decennium
Joined
Aug 24, 2012
Messages
605
Reaction score
305
Hey, anyone that can explain this properly?
I don't know what half of this is
Code:
public PollContentsComposer()
            : base(ServerPacketHeader.PollContentsMessageComposer)
        {
            WriteInteger(1); //poll id
            WriteString("Customer Satisfaction Poll"); //Title
            WriteString("Thanks for participating in our poll. We hope you enjoy playing Fuse Hotel."); //Ending message
            WriteInteger(2); //Questions
            {
                WriteInteger(9299); //id?
                WriteInteger(1); //sort order?
                WriteInteger(1); //type?
                WriteString("Would you recommend Fuse to a friend?");
                WriteInteger(0); //also some kind of type? question sort idk
                WriteInteger(1);
                WriteInteger(5); //count of questions?
                WriteString("1");
                WriteString("Definitely");
                WriteInteger(1);
                WriteString("2");
                WriteString("Maybe");
                WriteInteger(2);
                WriteString("3");
                WriteString("Don't know");
                WriteInteger(3);
                WriteString("4");
                WriteString("Probably not");
                WriteInteger(3);
                WriteString("5");
                WriteString("Definitely not");
                WriteInteger(3);
                WriteInteger(3);

                WriteInteger(9117);
                WriteInteger(2);
                WriteInteger(1);
                WriteString("What was the primary reason for the score you just gave us?");
                WriteInteger(1);
                WriteInteger(1);
                WriteInteger(6);
                WriteString("1");
                WriteString("Friends");
                WriteInteger(0);
                WriteString("2");
                WriteString("Avatar clothes and looks");
                WriteInteger(0);
                WriteString("3");
                WriteString("Pets");
                WriteInteger(0);
                WriteString("4");
                WriteString("Room building");
                WriteInteger(0);
                WriteString("5");
                WriteString("Room games");
                WriteInteger(0);
                WriteString("6");
                WriteString("Other");
                WriteInteger(0);

                WriteInteger(9342);
                WriteInteger(3);
                WriteInteger(1);
                WriteString("What was the primary reason for the score you just gave us?");
                WriteInteger(2);
                WriteInteger(1);
                WriteInteger(6);
                WriteString("1");
                WriteString("Friends");
                WriteInteger(0);
                WriteString("2");
                WriteString("Avatar clothes and looks");
                WriteInteger(0);
                WriteString("3");
                WriteString("Pets");
                WriteInteger(0);
                WriteString("4");
                WriteString("Room building");
                WriteInteger(0);
                WriteString("5");
                WriteString("Room games");
                WriteInteger(0);
                WriteString("6");
                WriteString("Other");
                WriteInteger(0);

                WriteInteger(9336);
                WriteInteger(4);
                WriteInteger(1);
                WriteString("What was the primary reason for the score you just gave us?");
                WriteInteger(3);
                WriteInteger(1);
                WriteInteger(5);
                WriteString("1");
                WriteString("Moderation");
                WriteInteger(0);
                WriteString("2");
                WriteString("Prices");
                WriteInteger(0);
                WriteString("3");
                WriteString("Bullying");
                WriteInteger(0);
                WriteString("4");
                WriteString("Cybering");
                WriteInteger(0);
                WriteString("5");
                WriteString("Other");
                WriteInteger(0);

                WriteInteger(9120);
                WriteInteger(2);
                WriteInteger(3);
                WriteString(
                    " What is the most important improvement that would make you more likely to recommend us?");
                WriteInteger(0);
                WriteInteger(3);
                WriteInteger(0);
                WriteInteger(0);
            }
            WriteBoolean(true);

        }
 
Did this a while ago, it might help? Wasn't sure on some bits myself either.

PHP:
	class PollContentsComposer : ServerPacket
	{
		public PollContentsComposer(RoomPoll poll)
			: base(ServerPacketHeader.PollContentsMessageComposer)
		{
			base.WriteInteger(poll.Id);
			base.WriteString(poll.Headline);
			base.WriteString(poll.CompletionMessage);

			base.WriteInteger(poll.Questions.Count);
			foreach (RoomPollQuestion question in poll.Questions.Values)
			{
				base.WriteInteger(question.Id);
				base.WriteInteger(question.SeriesOrder);
				base.WriteInteger(RoomPollQuestionTypeUtility.GetQuestionType(question.Type));
				base.WriteString(question.Question);

				base.WriteInteger(0);//??
				base.WriteInteger(question.MinimumSlections);// Min selections

				base.WriteInteger(question.Selections.Count);
				foreach (RoomPollQuestionSelection Selection in question.Selections.Values)
				{
					base.WriteString(Selection.Value);
					base.WriteString(Selection.Text);
					base.WriteInteger(Selection.Id);
				}

				base.WriteInteger(0);//??
			}
			base.WriteBoolean(true);//No idea
		}
	}
 
Upvote 0
Did this a while ago, it might help? Wasn't sure on some bits myself either.

PHP:
    class PollContentsComposer : ServerPacket
    {
        public PollContentsComposer(RoomPoll poll)
            : base(ServerPacketHeader.PollContentsMessageComposer)
        {
            base.WriteInteger(poll.Id);
            base.WriteString(poll.Headline);
            base.WriteString(poll.CompletionMessage);

            base.WriteInteger(poll.Questions.Count);
            foreach (RoomPollQuestion question in poll.Questions.Values)
            {
                base.WriteInteger(question.Id);
                base.WriteInteger(question.SeriesOrder);
                base.WriteInteger(RoomPollQuestionTypeUtility.GetQuestionType(question.Type));
                base.WriteString(question.Question);

                base.WriteInteger(0);//??
                base.WriteInteger(question.MinimumSlections);// Min selections

                base.WriteInteger(question.Selections.Count);
                foreach (RoomPollQuestionSelection Selection in question.Selections.Values)
                {
                    base.WriteString(Selection.Value);
                    base.WriteString(Selection.Text);
                    base.WriteInteger(Selection.Id);
                }

                base.WriteInteger(0);//??
            }
            base.WriteBoolean(true);//No idea
        }
    }

What I was confused about was the "free hand writing" thing that's available too, where they ask like
What is the most important improvement that would make you more likely to recommend us?
and you have like a textarea available
 
Upvote 0
What I was confused about was the "free hand writing" thing that's available too, where they ask like
What is the most important improvement that would make you more likely to recommend us?
and you have like a textarea available

Oh, pretty sure that's down to this line:

PHP:
base.WriteInteger(RoomPollQuestionTypeUtility.GetQuestionType(question.Type));

Which I have down as:

PHP:
		public static int GetQuestionType(RoomPollQuestionType Type)
		{
			switch (Type)
			{
				default:
				case RoomPollQuestionType.Radio:
					return 1;
				case RoomPollQuestionType.Checkbox:
					return 2;
				case RoomPollQuestionType.Textbox:
					return 3;
			}
		}

So, the integer defines what shows.
 
Upvote 0
Oh, pretty sure that's down to this line:

PHP:
base.WriteInteger(RoomPollQuestionTypeUtility.GetQuestionType(question.Type));

Which I have down as:

PHP:
        public static int GetQuestionType(RoomPollQuestionType Type)
        {
            switch (Type)
            {
                default:
                case RoomPollQuestionType.Radio:
                    return 1;
                case RoomPollQuestionType.Checkbox:
                    return 2;
                case RoomPollQuestionType.Textbox:
                    return 3;
            }
        }

So, the integer defines what shows.

Ah, yes.
Can't really find you on skype, you seem to be offline? Might you hit me up on wizcsharp
No help related questions lol, just fancy a chat once in a while. It's been a while
 
Upvote 0
Ah, yes.
Can't really find you on skype, you seem to be offline? Might you hit me up on wizcsharp
No help related questions lol, just fancy a chat once in a while. It's been a while

No probs. Added you, I've had a fair few different accounts since the last time (the Skype I've added you on starts with 2 X's, has a z in the middle and ends with 2 X's).
 
Upvote 0
Back