Attribute VB_Name = "modData" Function selectPacket(strData As String, Index As Integer) 'Select what action has to happen Dim sOff As Integer Dim sLen As Integer Dim sPart() As String strData = filterPacket(strData) 'Filter the packet on exploitable Chars (Chrs) 'Cut the packet in pieces, since packets like to stick at each other sNew: ReDim Preserve sPart(sOff) As String sLen = decodeNum(Mid(strData, 1, 3)) sPart(sOff) = Mid(strData, 4, sLen) strData = Right(strData, Len(strData) - sLen - 3) sOff = sOff + 1 If Len(strData) >= 1 Then GoTo sNew For p = 0 To UBound(sPart) 'For each packet in the packet-pack strData = sPart(p) 'Set the current packet Call Console.WriteLine(Index & "> " & strData) 'Packetlog it in the window, put a ' for it to disable Select Case Left(strData, 2) 'Select the packet header Case "CN" 'Encryption status Send Index, "DUIH" & Chr(1) Case "CJ" 'Date formats Send Index, "DAQBHHIIKHJIPAHQAdd-MM-yyyySAHPBhttp://hotel-nlQBH" 'Send Index, "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) Case "@q" 'Send current date Send Index, "Bc" & Format(Day(Now), "00") & "-" & Format(Month(Now), "00") & "-" & Year(Now) & Chr(1) Case "@j" 'Check if 'I want this name at register' is valid and not chosen yet funcLib.checkName strData, Index Case "CK" 'Check if 'I want this password at register' is valid at length etc funcLib.checkPassword strData, Index Case "CE", "@n" 'Packet required at registration Send Index, "DO" & Chr(1) Case "BR" 'Packet required at registration Send Index, "CY1" & Chr(1) Case "@k" 'Send the registration data, so the server can process it funcLib.V7Register strData, Index Case "@D" 'Normal, non-SSO (site) login If Server.ssoLogin = False Then 'If SSO login is disabled (so normal login is enabled) funcLib.V7Login strData, Index Else 'SSO login is required, not via this way Sir Send Index, "BK" & "Sorry, but login is not allowed via this way, ticket login is required." & Chr(1) End If Case "CL" 'SSO, site login If Server.ssoLogin = True Then 'If SSO login is enabled (so normal login is disabled) funcLib.V12Login strData, Index Else 'SSO login is disabled, not via this way Sir Send Index, "BK" & "Sorry, but login is not allowed via this way, ticket login is disabled." & Chr(1) End If Case "@G" 'Prepare user info in memory and send the user's badges funcLib.getUserInfo Index 'funcLib.processBadges Index (disabled) Case "@L" 'Load the users console (messenger) funcLib.grabConsole Index Case "@O" 'Update the users lastvisit date HoloDB.runQuery ("UPDATE users SET lastvisit = '" & Format(Date, "dd-mm-yyyy") & " " & Format(Time, "hh:mm") & "' WHERE name = '" & Holo(Index).Name & "'") Case "@Z" 'Do the actions for the user's Club status funcLib.processClub Index Case "@H" 'Send the data gathered in memory to the user, making it login funcLib.processUserInfo Index Case "@l" 'Update your mission + look and/or sex on Hotel View funcLib.updateDetails strData, Index Case "@d" 'Change your console mission (happens when you click the Console away) funcLib.changeConsoleMission strData, Index Case "BA" 'Redeem a voucher in your Purse funcLib.redeemVoucher strData, Index Case "B~" 'Buy Club subscription funcLib.buyClub strData, Index Case "@i" 'Search a user on the Console (messenger) funcLib.messengerSearch strData, Index Case "BV" 'Navigator categories funcLib.navLists strData, Index Case "BW" 'Navigator guestroom categories index for users funcLib.navLists "BVGCINDEX", Index Case "@]" 'Create a new guestroom funcLib.newRoom strData, Index Case "@Y" 'Update guestroom details funcLib.updateRoom strData, Index Case "BX" 'Modify guestroom funcLib.modifyRoom strData, Index, 0 Case "@X" 'Modify guestroom - roomname + opentype etc funcLib.modifyRoom strData, Index, 1 Case "BY" 'Modify guestroom - change category funcLib.modifyRoom strData, Index, 2 Case "@P" 'See guestrooms of a user funcLib.seeUserRooms strData, Index Case "@Q" 'Search a guestroom funcLib.searchRoom strData, Index Case "DH" 'Refresh recommended rooms section funcLib.refreshRecRooms Index Case "Bv" 'Bvgeneral packet, goes on with loading a room Send Index, "DB0" & Chr(1) Holo(Index).forceUpdate = False Case "@B" 'Enter a room (guestroom/publicroom) funcLib.enterRoom strData, Index Case "@y" 'Enter a guestroom, check state funcLib.enterGuestroom_State strData, Index Case "@U" 'Enter a guestroom, get number funcLib.enterGuestroom strData, Index Case "@{" 'Enter a guestroom, wallpaper etc funcLib.enterGuestroom_Decor strData, Index If Holo(Index).receivedFurniIndex = False Then Send Index, FSO.OpenTextFile(App.Path & "\bin\catalogue\index_sprites.bin", ForReading).ReadAll & Chr(1) Holo(Index).receivedFurniIndex = True Case "@~" 'Enter a guestroom, user/furniture/poster packet funcLib.enterGuestroom_Content Index Case "@" 'Enter a guestroom, door + user packet to room funcLib.enterGuestroom_Personal Index Case "AO" 'User turns his/her face to something else funcLib.setLook Index, Val(Mid(Split(strData, " ")(0), 3)), Val(Split(strData, " ")(1)) Case "As" 'User clicks door of room funcLib.leaveRoom Index, True Case "CW" 'User asks furniture sprite index packet (if not received = PH boxes) If Holo(Index).receivedFurniIndex = False Then Send Index, FSO.OpenTextFile(App.Path & "\bin\catalogue\index_sprites.bin", ForReading).ReadAll & Chr(1) Holo(Index).receivedFurniIndex = True Case "A^" 'User waves Holo(Index).Actions(3) = 3 'Waving - phase 1 Holo(Index).forceUpdate = True Case "A]" 'User dances If (Holo(Index).Actions(1) > 0 Or Holo(Index).Actions(2) > 0) = False Then 'If the user doesn't sit or lays If Len(strData) > 2 Then 'Club dance If Holo(Index).ClubDays > 0 Then dT = decodeVL64(Mid(strData, 3)) If dT > 4 Then dT = 1 Else dT = 1 End If Else dT = 1 End If Holo(Index).Actions(3) = 0 'Stop waving Holo(Index).Actions(4) = dT End If If dT = "" Or dT > 4 Then dT = 1 Holo(Index).Actions(4) = dT Holo(Index).forceUpdate = True Case "AX" 'Stop an action funcLib.stopAction strData, Index Case "B^" 'Change your badge 'bID = Mid(strData, 5, decodeB64(Mid(strData, 3, 2))) 'bStatus = decodeVL64(Right(strData, 1)) 'If (bStatus = "0" Or bStatus = "1") = False Then bStatus = "1" 'bRow = HoloDB.runRead("SELECT badges FROM users WHERE name = '" & Holo(Index).Name & "'") 'If InStr(bRow, "/" & bID & "/") Then ' ' bRow = "/" & bStatus & "/" & bID & "/" & Mid(bRow, 8) ' HoloDB.runQuery ("UPDATE users SET badges = '" & bRow & "' WHERE name = '" & Holo(Index).Name & "'") ' If Holo(Index).guestRoom > 0 Then sendGuestRoom Holo(Index).guestRoom, "Cd" & encodeVL64(Holo(Index).rNum) & bID & Chr(2) & Chr(1) 'Else ' funcLib.forceError Index 'End If Case "@u" 'Leave room funcLib.leaveRoom Index, True Case "@t", "@w", "@x" 'Talk, shout and whisper funcLib.doChat strData, Index Case "Cm" 'V14 CFH - Open the window to ask a question 'Send Index, "DH" Send Index, "BK" & "Sorry, but currently you are unable to send questions to the moderators." & Chr(1) Case "AV" 'V14 CFH - Send CFH to staff 'funcLib.sendCFH strData, Index Case "AK" 'User clicks somewhere to walk With Holo(Index) .DestX = decodeNum(Mid(strData, 3, 2)) .DestY = decodeNum(Mid(strData, 5, 2)) .Actions(2) = 0 .forceUpdate = True End With Case "Ae" 'User requests catalogue pages index funcLib.loadCatIndex Index Case "Af" 'User requests content of certain catalogue page funcLib.loadCatPage strData, Index Case "AA" 'Manage the Hand funcLib.doHand Mid(strData, 3), Index Case "Ad" 'User buys something from the catalogue funcLib.buyFurniture strData, Index Case "AB" 'Wallpaper & floor rug coloring funcLib.changeDecor strData, Index Case "AZ" 'Place furniture down funcLib.placeFurniture strData, Index Case "AC" 'Pickup furniture funcLib.pickupFurniture strData, Index Case "AI" 'Rotate/move furniture funcLib.rotateFurniture strData, Index Case "AS" 'Open a stickie fID = Mid(strData, 3) fRow = HoloDB.runRead("SELECT colour,var FROM furniture WHERE id = '" & fID & "'") Send Index, "@p" & fID & Chr(9) & Split(fRow, Chr(9))(0) & " " & Replace(Replace(Split(fRow, Chr(9))(1), Chr(129), "'"), Chr(130), Chr(13)) & Chr(1) Case "AT" 'Save the stuff in a stickie (happens when you close it) fID = Split(Mid(strData, 3), "/")(0) fColour = Left(Split(strData, "/")(1), 6) If fColour = "FFFF33" Or fColour = "9CFF9C" Or fColour = "FF9CFF" Or fColour = "9CCEFF" Then fMsg = Replace(Replace(funcLib.bFilter(Mid(strData, InStr(strData, " ") + 1), Index), Chr(129), "'"), Chr(13), Chr(130)) stickieRow = HoloDB.runRead("SELECT pos,room FROM furniture WHERE id = '" & fID & "'") If Split(stickieRow, Chr(9))(1) = Holo(Index).guestRoom Then HoloDB.runQuery ("UPDATE furniture SET colour = '" & fColour & "',var = '" & fMsg & "' WHERE id = '" & fID & "'") sendGuestRoom Holo(Index).guestRoom, "AU" & fID & Chr(9) & "post.it" & Chr(9) & " " & Split(stickieRow, Chr(9))(0) & Chr(9) & fColour & Chr(1) End If End If Case "AU" 'Delete a stickie fID = Mid(strData, 3) If Holo(Index).isOwner = True Or InStr(Rank(Holo(Index).Rank).fuseRights, "fuse_remove_stickies") Then stickieRow = HoloDB.runRead("SELECT name,room FROM furniture WHERE id = '" & fID & "'") If Split(stickieRow, Chr(9))(0) = "post.it" And Split(stickieRow, Chr(9))(1) = Holo(Index).guestRoom Then HoloDB.runQuery ("DELETE FROM furniture WHERE id = '" & fID & "'") sendGuestRoom Holo(Index).guestRoom, "AT" & fID & Chr(1) Else funcLib.forceError Index End If End If Case "Cw" 'Habbowheel fID = decodeVL64(Mid(strData, 3)) If IsNumeric(fID) = True And (Holo(Index).isOwner = True Or Holo(Index).hasRights = True) Then fRow = HoloDB.runRead("SELECT name,pos,room FROM furniture WHERE id = '" & fID & "'") fDat = Split(fRow, Chr(9)) If fDat(2) = Holo(Index).guestRoom And fDat(0) = "habbowheel" Then sendGuestRoom Holo(Index).guestRoom, "AU" & fID & Chr(9) & " habbowheel " & Chr(9) & fDat(1) & Chr(9) & modWin.rndVal(10, 29) & Chr(1) End If End If End Select Next End Function Private Function filterPacket(strData) As String For C = 1 To 12 'Remove the chars 1 to 12 from the packet strData = Replace(strData, Chr(C), " ") Next C filterPacket = strData 'Output the new packet End Function