Advertisement
Guest User

Class33.cs

a guest
Sep 8th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 24.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using Phoenix.HabboHotel.Misc;
  5. using Phoenix.HabboHotel.GameClients;
  6. using Phoenix.HabboHotel.Users;
  7. using Phoenix.HabboHotel.Pets;
  8. using Phoenix.HabboHotel.Pathfinding;
  9. using Phoenix.Util;
  10. using Phoenix.Messages;
  11. using Phoenix.HabboHotel.RoomBots;
  12. using Phoenix.HabboHotel.Items;
  13. using Phoenix.Storage;
  14.  
  15. namespace Phoenix.HabboHotel.Rooms
  16. {
  17.     internal sealed class Class33
  18.     {
  19.         public uint uint_0;
  20.         public int int_0;
  21.         public uint uint_1;
  22.         public int int_1;
  23.         internal int int_2;
  24.         public int int_3;
  25.         public int int_4;
  26.         public double double_0;
  27.         internal byte byte_0;
  28.         public int int_5;
  29.         public int int_6;
  30.         public int int_7;
  31.         public int int_8;
  32.         public bool bool_0;
  33.         public bool bool_1;
  34.         public bool bool_2;
  35.         public int int_9;
  36.         public int int_10;
  37.         public int int_11;
  38.         public bool bool_3;
  39.         public bool bool_4;
  40.         public int int_12;
  41.         public int int_13;
  42.         public double double_1;
  43.         public Class34 class34_0;
  44.         public Class99 class99_0;
  45.         internal byte byte_1;
  46.         internal bool bool_5;
  47.         public Class33 class33_0;
  48.         public Class63 class63_0;
  49.         public Class34 class34_1;
  50.         public Pet class15_0;
  51.         public bool bool_6;
  52.         public bool bool_7;
  53.         public bool bool_8;
  54.         public int int_14;
  55.         public Dictionary<string, string> Statusses;
  56.         public int int_15;
  57.         public int int_16;
  58.         public bool bool_10;
  59.         public int int_17;
  60.         public int int_18;
  61.         public int int_19;
  62.         internal bool bool_11;
  63.         internal bool bool_12;
  64.         internal string string_0;
  65.         internal int int_20;
  66.         public ThreeDCoord GStruct1_0
  67.         {
  68.             get
  69.             {
  70.                 return new ThreeDCoord(this.int_3, this.int_4);
  71.             }
  72.         }
  73.         public bool Boolean_0
  74.         {
  75.             get
  76.             {
  77.                 return this.Boolean_4 && this.class34_0.Boolean_0;
  78.             }
  79.         }
  80.         internal bool Boolean_1
  81.         {
  82.             get
  83.             {
  84.                 return this.int_15 >= 1;
  85.             }
  86.         }
  87.         internal bool Boolean_2
  88.         {
  89.             get
  90.             {
  91.                 return !this.Boolean_4 && this.int_1 >= Class13.int_15;
  92.             }
  93.         }
  94.         internal bool Boolean_3
  95.         {
  96.             get
  97.             {
  98.                 return !this.Boolean_4 && this.Statusses.ContainsKey("trd");
  99.             }
  100.         }
  101.         internal bool Boolean_4
  102.         {
  103.             get
  104.             {
  105.                 return this.class34_0 != null;
  106.             }
  107.         }
  108.         public Class33(uint uint_2, uint uint_3, int int_21, bool bool_13)
  109.         {
  110.             this.bool_5 = false;
  111.             this.uint_0 = uint_2;
  112.             this.uint_1 = uint_3;
  113.             this.int_0 = int_21;
  114.             this.int_1 = 0;
  115.             this.int_3 = 0;
  116.             this.int_4 = 0;
  117.             this.double_0 = 0.0;
  118.             this.int_7 = 0;
  119.             this.int_8 = 0;
  120.             this.bool_7 = true;
  121.             this.Statusses = new Dictionary<string, string>();
  122.             this.int_16 = 0;
  123.             this.int_19 = -1;
  124.             this.class33_0 = null;
  125.             this.bool_1 = false;
  126.             this.bool_0 = true;
  127.             this.bool_11 = false;
  128.             this.byte_0 = 3;
  129.             this.int_2 = 0;
  130.             this.int_20 = 0;
  131.             this.byte_1 = 0;
  132.             this.bool_12 = bool_13;
  133.             this.string_0 = "";
  134.         }
  135.         public void method_0()
  136.         {
  137.             this.int_1 = 0;
  138.             if (this.bool_8)
  139.             {
  140.                 this.bool_8 = false;
  141.                 ServerMessage gClass = new ServerMessage(486u);
  142.                 gClass.AppendInt32(this.int_0);
  143.                 gClass.AppendBoolean(false);
  144.                 this.method_17().SendMessage(gClass, null);
  145.             }
  146.         }
  147.         internal void method_1(GameClient class16_0, string string_1, bool bool_13)
  148.         {
  149.             string object_ = string_1;
  150.             if (class16_0 == null || (class16_0.GetHabbo().HasFuse("ignore_roommute") || !this.method_17().bool_4))
  151.             {
  152.                 this.method_0();
  153.                 if (!this.Boolean_4 && this.method_16().GetHabbo().bool_3)
  154.                 {
  155.                     this.method_16().SendNotif(PhoenixEnvironment.smethod_1("error_muted"));
  156.                 }
  157.                 else
  158.                 {
  159.                     if (!string_1.StartsWith(":") || class16_0 == null || !ChatCommandHandler.smethod_5(class16_0, string_1.Substring(1)))
  160.                     {
  161.                         uint num = 24u;
  162.                         if (bool_13)
  163.                         {
  164.                             num = 26u;
  165.                         }
  166.                         if (!this.Boolean_4 && class16_0.GetHabbo().method_4() > 0)
  167.                         {
  168.                             TimeSpan timeSpan = DateTime.Now - class16_0.GetHabbo().dateTime_0;
  169.                             if (timeSpan.Seconds > 4)
  170.                             {
  171.                                 class16_0.GetHabbo().int_23 = 0;
  172.                             }
  173.                             if (timeSpan.Seconds < 4 && class16_0.GetHabbo().int_23 > 5 && !this.Boolean_4)
  174.                             {
  175.                                 ServerMessage gClass = new ServerMessage(27u);
  176.                                 gClass.AppendInt32(class16_0.GetHabbo().method_4());
  177.                                 this.method_16().method_14(gClass);
  178.                                 this.method_16().GetHabbo().bool_3 = true;
  179.                                 this.method_16().GetHabbo().int_4 = class16_0.GetHabbo().method_4();
  180.                                 return;
  181.                             }
  182.                             class16_0.GetHabbo().dateTime_0 = DateTime.Now;
  183.                             class16_0.GetHabbo().int_23++;
  184.                         }
  185.                         if (!this.Boolean_4 && !class16_0.GetHabbo().bool_0)
  186.                         {
  187.                             string_1 = ChatCommandHandler.smethod_4(string_1);
  188.                         }
  189.                         if (!this.method_17().method_9(this, string_1))
  190.                         {
  191.                             ServerMessage gClass2 = new ServerMessage(num);
  192.                             gClass2.AppendInt32(this.int_0);
  193.                             if (string_1.Contains("http://") || string_1.Contains("www.") || string_1.Contains("https://"))
  194.                             {
  195.                                 string[] array = string_1.Split(new char[]
  196.                                 {
  197.                                     ' '
  198.                                 });
  199.                                 int num2 = 0;
  200.                                 string text = "";
  201.                                 string text2 = "";
  202.                                 string[] array2 = array;
  203.                                 for (int i = 0; i < array2.Length; i++)
  204.                                 {
  205.                                     string text3 = array2[i];
  206.                                     if (ChatCommandHandler.InitLinks(text3))
  207.                                     {
  208.                                         if (num2 > 0)
  209.                                         {
  210.                                             text += ",";
  211.                                         }
  212.                                         text += text3;
  213.                                         object obj = text2;
  214.                                         text2 = string.Concat(new object[]
  215.                                         {
  216.                                             obj,
  217.                                             " {",
  218.                                             num2,
  219.                                             "}"
  220.                                         });
  221.                                         num2++;
  222.                                     }
  223.                                     else
  224.                                     {
  225.                                         text2 = text2 + " " + text3;
  226.                                     }
  227.                                 }
  228.                                 string_1 = text2;
  229.                                 string[] array3 = text.Split(new char[]
  230.                                 {
  231.                                     ','
  232.                                 });
  233.                                 gClass2.AppendStringWithBreak(string_1);
  234.                                 if (array3.Length > 0)
  235.                                 {
  236.                                     gClass2.AppendBoolean(false);
  237.                                     gClass2.AppendInt32(num2);
  238.                                     array2 = array3;
  239.                                     for (int i = 0; i < array2.Length; i++)
  240.                                     {
  241.                                         string text4 = array2[i];
  242.                                         string text5 = ChatCommandHandler.smethod_3(text4.Replace("http://", "").Replace("https://", ""));
  243.                                         gClass2.AppendStringWithBreak(text5.Replace("http://", "").Replace("https://", ""));
  244.                                         gClass2.AppendStringWithBreak(text4);
  245.                                         gClass2.AppendBoolean(false);
  246.                                     }
  247.                                 }
  248.                             }
  249.                             else
  250.                             {
  251.                                 gClass2.AppendStringWithBreak(string_1);
  252.                             }
  253.                             gClass2.AppendInt32(this.method_2(string_1));
  254.                             gClass2.AppendBoolean(false);
  255.                             if (!this.Boolean_4)
  256.                             {
  257.                                 this.method_17().method_58(gClass2, class16_0.GetHabbo().list_2, class16_0.GetHabbo().Id);
  258.                             }
  259.                             else
  260.                             {
  261.                                 this.method_17().SendMessage(gClass2, null);
  262.                             }
  263.                         }
  264.                         else
  265.                         {
  266.                             if (!this.Boolean_4)
  267.                             {
  268.                                 class16_0.GetHabbo().method_28(string_1);
  269.                             }
  270.                         }
  271.                         if (!this.Boolean_4)
  272.                         {
  273.                             this.method_17().method_7(this, string_1, bool_13);
  274.                             if (class16_0.GetHabbo().CurrentQuestId == 3u)
  275.                             {
  276.                                 Phoenix.GetGame().GetQuestManager().method_1(3u, class16_0);
  277.                             }
  278.                         }
  279.                         if (Class13.Boolean_4 && !this.Boolean_4)
  280.                         {
  281.                             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  282.                             {
  283.                                 @class.AddParamWithValue("message", object_);
  284.                                 @class.ExecuteQuery(string.Concat(new object[]
  285.                                 {
  286.                                     "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
  287.                                     class16_0.GetHabbo().Id,
  288.                                     "','",
  289.                                     this.method_17().Id,
  290.                                     "','",
  291.                                     DateTime.Now.Hour,
  292.                                     "','",
  293.                                     DateTime.Now.Minute,
  294.                                     "',UNIX_TIMESTAMP(),@message,'",
  295.                                     class16_0.GetHabbo().Username,
  296.                                     "','",
  297.                                     DateTime.Now.ToLongDateString(),
  298.                                     "')"
  299.                                 }));
  300.                             }
  301.                             /* Autoban System made by Dario for RetroTown.ws! */
  302.                             if (chatcontainsautobanwords(object_) == true)
  303.                             {
  304.                                 string unnoetig2 = autoban(class16_0, object_, class16_0.GetHabbo().Id);
  305.                             }
  306.                             /* End Autoban System made by Dario for RetroTown.ws*/
  307.  
  308.                         }
  309.                     }
  310.                 }
  311.             }
  312.         }
  313.         internal int method_2(string string_1)
  314.         {
  315.             string_1 = string_1.ToLower();
  316.             int result;
  317.             if (string_1.Contains(":)") || string_1.Contains(":d") || string_1.Contains("=]") || string_1.Contains("=d") || string_1.Contains(":>"))
  318.             {
  319.                 result = 1;
  320.             }
  321.             else
  322.             {
  323.                 if (string_1.Contains(">:(") || string_1.Contains(":@"))
  324.                 {
  325.                     result = 2;
  326.                 }
  327.                 else
  328.                 {
  329.                     if (string_1.Contains(":o") || string_1.Contains(";o"))
  330.                     {
  331.                         result = 3;
  332.                     }
  333.                     else
  334.                     {
  335.                         if (string_1.Contains(":(") || string_1.Contains(";<") || string_1.Contains("=[") || string_1.Contains(":'(") || string_1.Contains("='["))
  336.                         {
  337.                             result = 4;
  338.                         }
  339.                         else
  340.                         {
  341.                             result = 0;
  342.                         }
  343.                     }
  344.                 }
  345.             }
  346.             return result;
  347.         }
  348.         internal void method_3(bool bool_13)
  349.         {
  350.             this.bool_6 = false;
  351.             this.bool_10 = false;
  352.             this.Statusses.Remove("mv");
  353.             this.int_10 = 0;
  354.             this.int_11 = 0;
  355.             this.bool_4 = false;
  356.             this.int_12 = 0;
  357.             this.int_13 = 0;
  358.             this.double_1 = 0.0;
  359.             if (bool_13)
  360.             {
  361.                 this.bool_7 = true;
  362.             }
  363.         }
  364.         internal void method_4(ThreeDCoord gstruct1_0)
  365.         {
  366.             this.method_5(gstruct1_0.x, gstruct1_0.y);
  367.         }
  368.         internal void method_5(int int_21, int int_22)
  369.         {
  370.             if (this.method_17().method_92(int_21, int_22) && !this.method_17().method_96(int_21, int_22))
  371.             {
  372.                 this.method_0();
  373.                 this.bool_6 = true;
  374.                 this.bool_10 = true;
  375.                 this.int_17 = int_21;
  376.                 this.int_18 = int_22;
  377.                 if (int_21 >= this.method_17().Class28_0.int_4 || int_22 >= this.method_17().Class28_0.int_5)
  378.                 {
  379.                     this.int_10 = int_21;
  380.                     this.int_11 = int_22;
  381.                 }
  382.                 else
  383.                 {
  384.                     this.int_10 = this.method_17().gstruct1_0[int_21, int_22].x;
  385.                     this.int_11 = this.method_17().gstruct1_0[int_21, int_22].y;
  386.                 }
  387.             }
  388.         }
  389.         internal void method_6()
  390.         {
  391.             this.bool_1 = false;
  392.             this.bool_0 = true;
  393.         }
  394.         internal void method_7(int int_21, int int_22, double double_2)
  395.         {
  396.             this.int_3 = int_21;
  397.             this.int_4 = int_22;
  398.             this.double_0 = double_2;
  399.         }
  400.         public void method_8(int int_21)
  401.         {
  402.             this.int_5 = int_21;
  403.             if (int_21 > 1000)
  404.             {
  405.                 this.int_6 = 5000;
  406.             }
  407.             else
  408.             {
  409.                 if (int_21 > 0)
  410.                 {
  411.                     this.int_6 = 240;
  412.                 }
  413.                 else
  414.                 {
  415.                     this.int_6 = 0;
  416.                 }
  417.             }
  418.             ServerMessage gClass = new ServerMessage(482u);
  419.             gClass.AppendInt32(this.int_0);
  420.             gClass.AppendInt32(int_21);
  421.             this.method_17().SendMessage(gClass, null);
  422.         }
  423.         public void method_9(int int_21)
  424.         {
  425.             this.method_10(int_21, false);
  426.         }
  427.         public void method_10(int int_21, bool bool_13)
  428.         {
  429.             if (!this.Statusses.ContainsKey("lay") && !this.bool_6)
  430.             {
  431.                 int num = this.int_8 - int_21;
  432.                 this.int_7 = this.int_8;
  433.                 if (this.Statusses.ContainsKey("sit") || bool_13)
  434.                 {
  435.                     if (this.int_8 == 2 || this.int_8 == 4)
  436.                     {
  437.                         if (num > 0)
  438.                         {
  439.                             this.int_7 = this.int_8 - 1;
  440.                         }
  441.                         else
  442.                         {
  443.                             if (num < 0)
  444.                             {
  445.                                 this.int_7 = this.int_8 + 1;
  446.                             }
  447.                         }
  448.                     }
  449.                     else
  450.                     {
  451.                         if (this.int_8 == 0 || this.int_8 == 6)
  452.                         {
  453.                             if (num > 0)
  454.                             {
  455.                                 this.int_7 = this.int_8 - 1;
  456.                             }
  457.                             else
  458.                             {
  459.                                 if (num < 0)
  460.                                 {
  461.                                     this.int_7 = this.int_8 + 1;
  462.                                 }
  463.                             }
  464.                         }
  465.                     }
  466.                 }
  467.                 else
  468.                 {
  469.                     if (num <= -2 || num >= 2)
  470.                     {
  471.                         this.int_7 = int_21;
  472.                         this.int_8 = int_21;
  473.                     }
  474.                     else
  475.                     {
  476.                         this.int_7 = int_21;
  477.                     }
  478.                 }
  479.                 this.bool_7 = true;
  480.             }
  481.         }
  482.         public void method_11(string string_1, string string_2)
  483.         {
  484.             this.Statusses[string_1] = string_2;
  485.         }
  486.         public void method_12(string string_1)
  487.         {
  488.             if (this.Statusses.ContainsKey(string_1))
  489.             {
  490.                 this.Statusses.Remove(string_1);
  491.             }
  492.         }
  493.         public void method_13()
  494.         {
  495.             this.Statusses = new Dictionary<string, string>();
  496.         }
  497.         public void method_14(ServerMessage gclass5_0)
  498.         {
  499.             if (gclass5_0 != null && !this.bool_11)
  500.             {
  501.                 if (!this.Boolean_4)
  502.                 {
  503.                     if (this.method_16() != null && this.method_16().GetHabbo() != null)
  504.                     {
  505.                         Habbo @class = this.method_16().GetHabbo();
  506.                         gclass5_0.AppendUInt(@class.Id);
  507.                         gclass5_0.AppendStringWithBreak(@class.Username);
  508.                         gclass5_0.AppendStringWithBreak(@class.string_4);
  509.                         gclass5_0.AppendStringWithBreak(@class.string_5);
  510.                         gclass5_0.AppendInt32(this.int_0);
  511.                         gclass5_0.AppendInt32(this.int_3);
  512.                         gclass5_0.AppendInt32(this.int_4);
  513.                         gclass5_0.AppendStringWithBreak(this.double_0.ToString().Replace(',', '.'));
  514.                         gclass5_0.AppendInt32(2);
  515.                         gclass5_0.AppendInt32(1);
  516.                         gclass5_0.AppendStringWithBreak(@class.string_6.ToLower());
  517.                         gclass5_0.AppendInt32(-1);
  518.                         if (@class.int_0 > 0)
  519.                         {
  520.                             gclass5_0.AppendInt32(@class.int_0);
  521.                         }
  522.                         else
  523.                         {
  524.                             gclass5_0.AppendInt32(-1);
  525.                         }
  526.                         gclass5_0.AppendInt32(-1);
  527.                         gclass5_0.AppendStringWithBreak("");
  528.                         gclass5_0.AppendInt32(@class.int_13);
  529.                     }
  530.                 }
  531.                 else
  532.                 {
  533.                     gclass5_0.AppendInt32(this.class99_0.int_0);
  534.                     gclass5_0.AppendStringWithBreak(this.class34_0.string_1);
  535.                     gclass5_0.AppendStringWithBreak(this.class34_0.string_2);
  536.                     gclass5_0.AppendStringWithBreak(this.class34_0.string_3);
  537.                     gclass5_0.AppendInt32(this.int_0);
  538.                     gclass5_0.AppendInt32(this.int_3);
  539.                     gclass5_0.AppendInt32(this.int_4);
  540.                     gclass5_0.AppendStringWithBreak(this.double_0.ToString().Replace(',', '.'));
  541.                     gclass5_0.AppendInt32(4);
  542.                     gclass5_0.AppendInt32((this.class34_0.enum2_0 == Enum2.const_0) ? 2 : 3);
  543.                     if (this.class34_0.enum2_0 == Enum2.const_0)
  544.                     {
  545.                         gclass5_0.AppendInt32(0);
  546.                     }
  547.                 }
  548.             }
  549.         }
  550.         public void method_15(ServerMessage gclass5_0)
  551.         {
  552.             if (!this.bool_11)
  553.             {
  554.                 gclass5_0.AppendInt32(this.int_0);
  555.                 gclass5_0.AppendInt32(this.int_3);
  556.                 gclass5_0.AppendInt32(this.int_4);
  557.                 gclass5_0.AppendStringWithBreak(this.double_0.ToString().Replace(',', '.'));
  558.                 gclass5_0.AppendInt32(this.int_7);
  559.                 gclass5_0.AppendInt32(this.int_8);
  560.                 gclass5_0.AppendString("/");
  561.                 try
  562.                 {
  563.                     foreach (KeyValuePair<string, string> current in this.Statusses)
  564.                     {
  565.                         gclass5_0.AppendString(current.Key);
  566.                         gclass5_0.AppendString(" ");
  567.                         gclass5_0.AppendString(current.Value);
  568.                         gclass5_0.AppendString("/");
  569.                     }
  570.                 }
  571.                 catch
  572.                 {
  573.                 }
  574.                 gclass5_0.AppendStringWithBreak("/");
  575.             }
  576.         }
  577.         /* Autoban System made by Dario for Retrotown.ws */
  578.         public bool chatcontainsautobanwords(string t)
  579.         {
  580.             bool returned = false;
  581.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  582.             {
  583.                 DataTable dataTable = @class.ReadDataTable("SELECT word FROM autoban_words");
  584.                 foreach (DataRow dataRow in dataTable.Rows)
  585.                 {
  586.                     if (t.Contains((string)dataRow["word"]))
  587.                     {
  588.                         returned = true;
  589.                     }
  590.                     else
  591.                     {
  592.                         returned = false;
  593.                     }
  594.                 }
  595.             }
  596.             return returned;
  597.         }
  598.         public string autoban(GameClient class16_0, string t, uint userid)
  599.         {
  600.             using (DatabaseClient @class = Phoenix.GetDatabase().GetClient())
  601.             {
  602.                 DataTable dataTable = @class.ReadDataTable("SELECT * FROM autoban_words");
  603.                 string reason = "Banned.";
  604.                 double banlength = 23004;
  605.                 foreach (DataRow dataRow in dataTable.Rows)
  606.                 {
  607.                     if (t.Contains((string)dataRow["word"]))
  608.                     {
  609.                         banlength = Convert.ToDouble((string)dataRow["banlength"]);
  610.                         reason = (string)dataRow["reason"];
  611.                     }
  612.  
  613.                 }
  614.                 @class.AddParamWithValue("var", class16_0.GetHabbo().Username);
  615.                 @class.AddParamWithValue("reason", reason);
  616.                 @class.AddParamWithValue("length", Phoenix.GetUnixTimestamp() + banlength);
  617.                 @class.ExecuteQuery(string.Concat(new object[] {
  618.     "INSERT INTO bans (bantype,value,reason,expire,added_by,added_date,appeal_state) VALUES ('user',@var,@reason,@length,'Dario','",
  619.     DateTime.Now.ToLongDateString(),
  620.     "', '1')"
  621. }));
  622.                 @class.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + userid + "' LIMIT 1");
  623.                 class16_0.method_7(reason);
  624.                 class16_0.method_12();
  625.             }
  626.             return "Banned Successfull";
  627.         }
  628.         /* End Autoban System made by Dario for RetroTown.ws */
  629.         public GameClient method_16()
  630.         {
  631.             GameClient result;
  632.             if (this.Boolean_4)
  633.             {
  634.                 result = null;
  635.             }
  636.             else
  637.             {
  638.                 result = Phoenix.GetGame().GetClientManager().method_2(this.uint_0);
  639.             }
  640.             return result;
  641.         }
  642.         private Room method_17()
  643.         {
  644.             return Phoenix.GetGame().GetRoomManager().GetRoom(this.uint_1);
  645.         }
  646.     }
  647. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement