[ION/Deltar] [C#] Frequently Asked Questions

Status
Not open for further replies.

Quackster

a devbest user says what
Aug 22, 2010
1,763
1,235
"ION/Deltar is a base for programmers to expand their skills".​

SVN Download:

When you ever made a server using Deltar and see how the FAQ is bugged?

Well I made this very quickly :)

Step 1 Find \Net\Messages\ServerMessage.cs

And find:

Code:
public void AppendString(string s, byte Breaker)
{
     Append(s); // Append string with default encoding
     Append(Breaker); // Append breaker
}

And add below

Code:
public void AppendChar(byte Breaker)
{
    Append(Breaker); // Append breaker
}

Step 2

Execute this in the database

Code:
--
-- Table structure for table `faq_help`
--

CREATE TABLE IF NOT EXISTS `faq_help` (
  `id` int(140) NOT NULL AUTO_INCREMENT,
  `question` varchar(140) NOT NULL,
  `answer` varchar(500) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `faq_help`
--

INSERT INTO `faq_help` (`id`, `question`, `answer`) VALUES
(1, 'How do I get help with an account problem?', 'Please go to <a href="https://help.habbo.com/home">https://help.habbo.com/home</a> or click the ''Customer Support'' link at the bottom of the Habbo website. '),
(2, 'How do I get help with playing Habbo?', 'Refer to our new FAQs at <a href="https://help.habbo.com/forums">https://help.habbo.com/forums</a> for more information about Habbo.');

Step 3

Go to /HabboHotel/Client/Global.cs

Find

Code:
/// <summary>
/// 196 - "CD"
/// </summary>
private void Pong()
{
    Session.PingOK = true;
}

And add below

Code:
        /// <summary>
        /// 416 - "F`"
        /// </summary>
        private void FAQ()
        {
            using (DatabaseClient dbClient = AleedaEnvironment.GetDatabase().GetClient())
            {
                DataTable Table = dbClient.ReadDataTable("SELECT * FROM faq_help");

                Response.Initialize(ResponseOpcodes.FrequentlyAskedQuestions); // "F`"
                Response.AppendInt32(0);
                Response.AppendInt32(Table.Rows.Count);
                foreach (DataRow Row in Table.Rows)
                {
                    Response.AppendInt32(Convert.ToInt32(Row["id"]));
                    Response.AppendString(Convert.ToString(Row["question"]));
                }
                SendResponse();
            }
        }
        /// <summary>
        /// 418 - "Fb"
        /// </summary>
        private void FAQview()
        {
            int mID = Request.PopWiredInt32();
            
            using (DatabaseClient dbClient = AleedaEnvironment.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("id", mID);
                string mAnswer = dbClient.ReadString("SELECT answer FROM faq_help WHERE id = @id");

                Response.Initialize(520); // "HH"
                Response.AppendInt32(mID);
                Response.Append(mAnswer);
                
                //Help tool message
                Response.AppendChar(13);
                Response.AppendChar(10);
                Response.AppendChar(13);
                Response.AppendChar(10);
                Response.AppendString("The Help Tool is for account help, payment problems and ban queries. If you need general help with playing the game, please read the FAQs.");
                SendResponse();
            }
        }

Step 5

Scroll to the bottom (of Global.cs) and add these

Code:
mRequestHandlers[416] = new RequestHandler(FAQ);
mRequestHandlers[418] = new RequestHandler(FAQview);

Some things I would like to point out:

  • This is all coded, by me
  • I hope someone picks up on C#
  • If you cannot set this up, this thread IS NOT a help thread.

Your result?
 

Mastah

the funny thing is \r\n i did
Oct 25, 2010
739
41
Really like it thanks for releasing this i will sure use this hot!
 

Dayron1234

Rapnameiszero,cuzIhavezero,toleranceforidiots
Jun 30, 2010
772
35
Where is the download link to the emulator? I like this emulator lol, but good job.
 
Status
Not open for further replies.

Users who are viewing this thread

Top