Attribute VB_Name = "ServerPackets" Public Function PacketHandler(ByVal data As String, ByVal Index As Integer) Dim IP As String Dim MessageLength As Integer MessageLength = Encoding.decodeB64(Mid(data, 1, 2)) Dim newData As String newData = Encoding.decodeB64(Mid(data, 1, MessageLength)) Select Case newData Case 206 'CN MainFrm.sock(Index).SendData "DUIH " & Chr(1) Case 202 'CJ IP = MainFrm.sock(a).RemoteHostIP If clsMySQL.checkExists("SELECT ip FROM ipban WHERE ip = '" & IP & "'") = True Then DebugText ">> The client has recived a ip ban notice." MainFrm.sock(Index).SendData "BK" + "Your ip [" & IP & "] has been blocked from our server because of serious misbehaviour." & Chr(1) Else 'MainFrm.sock(Index).SendData "DAQBHHIIKHJIPAHQAdd-MM-yyyySAHPBhttp://hotel-nlQBH " MainFrm.sock(Index).SendData "DARAHIIIKHJIPAIQAdd-MM-yyyy" & Chr(2) & Chr(1) & "@H[100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,176,177,178,180,185,190,195,200,205,206,207,210,215,220,225,230,235,240,245,250,255,260,265,266,267,270,275,280,281,285,290,295,300,305,500,505,510,515,520,525,530,535,540,545,550,555,565,570,575,580,585,590,595,596,600,605,610,615,620,625,626,627,630,635,640,645,650,655,660,665,667,669,670,675,680,685,690,695,696,700,705,710,715,720,725,730,735,740]" & Chr(1) End If Case 49 '@q MainFrm.sock(Index).SendData "Bc" & Format(Day(Now), "00") & "-" & Format(Month(Now), "00") & "-" & Year(Now) & Chr(1) Case 131 'BC IP = MainFrm.sock(a).RemoteHostIP clsMySQL.runQuery ("INSERT INTO under_age (ip) VALUES ('" & IP & "')") MainFrm.sock(Index).SendData "CV" & Chr(1) Case 42 '@j Dim htlName As String htlName = Mid(data, 5, Encoding.decodeB64(Mid(data, 3, 2))) If clsMySQL.checkExists("SELECT name FROM users WHERE name = '" & htlName & "'") = True Then MainFrm.sock(Index).SendData "@dPA" & Chr(1) Else MainFrm.sock(Index).SendData "@dH" & Chr(1) End If Case 203 'CK MainFrm.sock(Index).SendData "DZH" & Chr(1) Case 197, 49 'CE, @n MainFrm.sock(Index).SendData "DO" & Chr(1) Case 43 '@k strTemp = Mid(data, 5) Name = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2)) + 2) Figure = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2)) + 2) Sex = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2)) + 6) Mail = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2)) + 2) Birth = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2)) + 11) Pass = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) IP = MainFrm.sock(a).RemoteHostIP LastOnline = Format(Date, "dd-mm-yyyy") & " " & Format(Time, "hh:mm") MainFrm.sock(Index).SendData "@C" & Chr(1) clsMySQL.runQuery ("INSERT INTO users (name,pass,email,ip,last_online,birthdate,figure,coins,rank,sex) VALUES ('" & Name & "','" & Pass & "','" & Mail & "','" & IP & "','" & LastOnlien & "','" & Birth & "','" & Figure & "','" & 1335 & "','" & 1 & "','" & Sex & "')") Case 146 'BR MainFrm.sock(Index).SendData "CY1 " & Chr(1) Case 4 '@D strTemp = Mid(data, 3) Name = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) strTemp = Mid(strTemp, 3 + decodeB64(Left(strTemp, 2))) Pass = Mid(strTemp, 3, decodeB64(Left(strTemp, 2))) CheckData = clsMySQL.runRead("SELECT id FROM users WHERE name = '" & Name & "' AND pass = '" & Pass & "'") If (CheckData = "") Then MainFrm.sock(Index).SendData "BK Wrong Username/Password!" & Chr(1) Else clsMySQL.runQuery ("UPDATE users SET lastip = '0' WHERE lastip = '" & MainFrm.sock(a).RemoteHostIP & "'") clsMySQL.runQuery ("UPDATE users SET lastip = '" & MainFrm.sock(a).RemoteHostIP & "' WHERE name = '" & Name & "' AND pass = '" & Pass & "'") MainFrm.sock(Index).SendData "@Bfuse_room_queue_defaultfuse_buy_creditsfuse_logindefaultfuse_trade" & Chr(1) MainFrm.sock(Index).SendData "@C" & Chr(1) MainFrm.sock(Index).SendData "@L" & Chr(1) End If Case 204 'CL Dim strTicket As String Dim ticketRow As String strTicket = Mid(data, 5) ticketRow = clsMySQL.runRead("SELECT sso FROM users WHERE sso = '" & strTicket & "'") If ticketRow <> "" Then MainFrm.sock(Index).SendData "@Bfuse_room_queue_defaultfuse_buy_creditsfuse_logindefaultfuse_trade" & Chr(1) MainFrm.sock(Index).SendData "@C" & Chr(1) MainFrm.sock(Index).SendData "@L" & Chr(1) Else MainFrm.sock(Index).SendData "BKSSO has failed." & Chr(1) End If Case 8 '@H IP = MainFrm.sock(a).RemoteHostIP Name2 = clsMySQL.runRead("SELECT name FROM users WHERE ip = '" & IP & "'") Coins = clsMySQL.runRead("SELECT coins FROM users WHERE ip = '" & IP & "'") Figur = clsMySQL.runRead("SELECT figure FROM users WHERE ip = '" & IP & "'") MainFrm.sock(Index).SendData "@E" & Index & Chr(2) & Name2 & Chr(2) & Figur & Chr(2) & f & Chr(2) & cake & Chr(2) & "Hch=s02/253,146,160" & Chr(2) & "HI" & Chr(1) & "@F" & Coins & Chr(1) & "A|" & 79 & Chr(1) & "@DH" & Chr(1) & "DtI" & Chr(1) & "DoH" & Chr(1) Case 150 'BV Dim categoryID As Integer Dim navBuilder As String categoryID = VL64Decode(Mid(data, 4)) If clsMySQL.checkExists("SELECT id FROM pub_rooms where id = '" & categoryID & "'") = True Then Dim categoryName As String Dim Showfull As Integer Showfull = VL64encode(Mid(data, 3, 1)) categoryName = clsMySQL.runRead("SELECT type FROM pub_rooms where id = '" & categoryID & "'") 'pub_name = clsMySQL.runRead("SELECT pub_name FROM pub_rooms where id = '" & categoryID & "'") 'Line = clsMySQL.runRead("SELECT line FROM pub_rooms where id = '" & categoryID & "'") 'cct = clsMySQL.runRead("SELECT cct FROM pub_rooms where id = '" & categoryID & "'") navBuilder = VL64encode(Showfull) & VL64encode(categoryID) & VL64encode(0) & categoryName & Chr(2) ' & pub_name & Chr(2) & Line & Chr(2) & cct & Chr(2) End If MainFrm.sock(Index).SendData "C\" & navBuilder & Chr(1) End Select End Function