public function UpdateSeasonalCurrencyBalance($util) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("ActivityPointsMessageComposer")); $response->WriteInt32(3); $response->WriteInt32(0); $response->WriteInt32($this->habbo['activity_points']); $response->WriteInt32(5); $response->WriteInt32($this->habbo['vip_points']); $response->WriteInt32(105); $response->WriteInt32($this->habbo['vip_points']); $this->Send($response->Finalize()); }
public static function RetrieveCitizenshipStatusEvent(User $user, PacketParser $packet, ClassContainer $util) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("CitizenshipStatusMessageComposer")); $response->WriteString($packet->readString()); $response->WriteInt32(4); $response->WriteInt32(4); $user->Send($response->Finalize()); }
public static function LandingRefreshRewardMessageEvent(User $user, PacketParser $packet, ClassContainer $util) { $promo = $util->Cache->hotelviewrewardpromo[0]; if ($promo['enabled'] == "1") { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("LandingRewardMessageComposer")); $response->WriteString($promo['furni_name']); $response->WriteInt32($promo['furni_id']); $response->WriteInt32(120); $response->WriteInt32(120 - $user->habbo['respect']); $user->Send($response->Finalize()); } }
public static function ConsoleInitEvent(User $user, PacketParser $packet, ClassContainer $util) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("LoadFriendsCategories")); $response->WriteInt32(2000); $response->WriteInt32(300); $response->WriteInt32(800); $response->WriteInt32(1100); $response->WriteInt32(0); //count //int id //str name $user->Send($response->Finalize()); $friends = $util->Database->Query("SELECT u.id,u.username,u.look,u.online,u.motto FROM messenger_friendships m, users u WHERE m.user_one_id = ? AND u.id = m.user_two_id ORDER BY online DESC", array($user->habbo['id'])); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("LoadFriendsMessageComposer")); $response->WriteInt32(1); $response->WriteInt32(0); $response->WriteInt32(count($friends)); foreach ($friends as $friend) { $response->WriteInt32($friend['id']); $response->WriteString($friend['username']); $response->WriteInt32($friend['online']); $response->WriteBoolean(false); $response->WriteBoolean(false); $response->WriteString($friend['look']); $response->WriteInt32(0); $response->WriteString($friend['motto']); $response->WriteString(""); $response->WriteString(""); $response->WriteBoolean(true); //persistedMessageUser $response->WriteBoolean(false); $response->WriteBoolean(false); //pockethabbo ? $response->WriteInt16(0); //relationship } $user->Send($response->Finalize()); }
public static function UserGetVolumeSettingsMessageEvent(User $user, PacketParser $packet, ClassContainer $util) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("LoadVolumeMessageComposer")); $response->WriteInt32($user->habbo['volume']); $response->WriteInt32($user->habbo['volume']); $response->WriteInt32($user->habbo['volume']); $response->WriteBoolean(false); //old chat $response->WriteBoolean(false); //ignore room invite $response->WriteBoolean(false); //disable camera follow $response->WriteInt32(3); //collapse friends (3 = no) $response->WriteInt32(0); //bubble $user->Send($response->Finalize()); }
public static function RoomGetHeightmapMessageEvent(User $user, PacketParser $packet, ClassContainer $util) { $room = $user->currentLoadingRoom; $model = $room->getModel(); $heightmap = String::replace($model['heightmap'], chr(0xa), ''); $split = explode(chr(0xd), $heightmap); $sizeX = strlen($split[0]); $sizeY = count($split); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("HeightMapMessageComposer")); $response->WriteInt32($sizeX); $response->WriteInt32($sizeX * $sizeY); for ($i = 0; $i < $sizeY; $i++) { for ($j = 0; $j < $sizeX; $j++) { $response->WriteInt16(0 * 256); } } $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("FloorMapMessageComposer")); $response->WriteBoolean(true); $response->WriteInt32(1); //wall height $response->WriteString($heightmap . chr(0xd)); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomFloorItemsMessageComposer")); $response->WriteInt32(1); //owner count $response->WriteInt32($room->getOwner()['id']); $response->WriteString($room->getOwner()['username']); $response->WriteInt32(0); //items count $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomWallItemsMessageComposer")); $response->WriteInt32(1); //owner count $response->WriteInt32($room->getOwner()['id']); $response->WriteString($room->getOwner()['username']); $response->WriteInt32(0); //items count $user->Send($response->Finalize()); }
public static function SerializePromotionsResultListFlatcats($cat, $direct = false, PacketConstructor $response) { $response->WriteString("new_ads"); $response->WriteString($cat['caption']); $response->WriteInt32(0); $response->WriteBoolean(true); $response->WriteInt32(-1); //TODO $response->WriteInt32(0); }
public function SerializeRoomData(ClassContainer $util, User $user, $isNotReload = false, $sendRoom = false, $show = true) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomDataMessageComposer")); $response->WriteBoolean($show); $this->Serialize($response, true, !$isNotReload); $response->WriteBoolean($isNotReload); $response->WriteBoolean(false); //public ? $response->WriteBoolean(!$isNotReload); $response->WriteBoolean($this->muted); $response->WriteInt32(0); //whocanmute $response->WriteInt32(0); //whocankick $response->WriteInt32(0); //whocanban $response->WriteBoolean(true); //room rights, need check here $response->WriteInt32(0); //chat type $response->WriteInt32(0); //chat balloon $response->WriteInt32(0); //chat speed $response->WriteInt32(14); //chat maxdistance $response->WriteInt32(0); //chat flood protection /* if ($sendRoom == null) return; */ //if ($sendRoom) { //$this->Send($response->Finalize()); //} else { //Console::WriteLine($response->Finalize()); $user->Send($response->Finalize()); //} }
public static function SearchNewNavigatorEvent(User $user, PacketParser $packet, ClassContainer $util) { $name = $packet->readString(); $junk = $packet->readString(); switch ($name) { case "official_view": $navigatorlength = 2; break; case "myworld_view": $navigatorlength = 5; break; case "hotel_view": case "roomads_view": $navigatorlength = count($util->Cache->navigatorcategories) + 1; break; default: $navigatorlength = 1; break; } $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("SearchResultSetComposer")); $response->WriteString($name); $response->WriteString($junk); //$response->WriteInt32(strlen($junk) > 0 ? 1 : $navigatorlength); if (strlen($junk) > 0) { $response->WriteInt32(strlen($junk) > 0 ? 1 : $navigatorlength); SearchResultList::SerializeSearches($junk, $response, $util); } else { $response->WriteInt32(0); //SearchResultList::SerializeSearchResultListStatics($name, true, $response, $util); } $user->Send($response->Finalize()); }
public static function SSOTicketMessageEvent(User $user, PacketParser $packet, ClassContainer $util) { $ticket = $packet->readString(); $query = $util->Database->Query("SELECT * FROM users WHERE auth_ticket = ? LIMIT 1", array($ticket)); if (count($query) == 0) { Console::WriteLine("User not found, ticket : " . $ticket); $user->disconnect(); } else { $check = $util->index->GetUserbyHabboId($query[0]['id']); if ($check) { $check->disconnect(); } $user->habbo = $query[0]; $util->index->habboid[$user->habbo['id']] =& $user; Console::WriteLine("- " . $user->habbo['username'] . " logged in !"); $util->Database->Exec("UPDATE users SET online = '1' WHERE id = ?", array($user->habbo['id'])); $util->Database->Exec("UPDATE server_status SET users_online = users_online + 1"); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("UniqueMachineIDMessageComposer")); $response->WriteString($user->HWID); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("AuthenticationOKMessageComposer")); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("HomeRoomMessageComposer")); $response->WriteInt32($user->habbo['home_room']); $response->WriteInt32($user->habbo['home_room']); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("MinimailCountMessageComposer")); $response->WriteInt32(0); $user->Send($response->Finalize()); $favoriterooms = $util->Database->Query("SELECT room_id FROM user_favorites WHERE user_id = ?", array($user->habbo['id'])); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("FavouriteRoomsMessageComposer")); $response->WriteInt32(30); $response->WriteInt32(count($favoriterooms)); foreach ($favoriterooms as $favorite) { $response->WriteInt32($favorite['room_id']); } $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("EnableNotificationsMessageComposer")); $response->WriteBoolean(true); $response->WriteBoolean(false); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("EnableTradingMessageComposer")); $response->WriteBoolean(true); $user->Send($response->Finalize()); } }
public static function LoadRoomForUser(User $user, ClassContainer $util) { $room = $user->currentLoadingRoom; $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomGroupMessageComposer")); $response->WriteInt32(0); //count //id //string $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("InitialRoomInfoMessageComposer")); $response->WriteString($room->getModelName()); $response->WriteInt32($room->getId()); $user->Send($response->Finalize()); if ($user->spectatorMode) { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("SpectatorModeMessageComposer")); $user->Send($response->Finalize()); } if ($room->getWallpaper() != "0.0") { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomSpacesMessageComposer")); $response->WriteString("wallpaper"); $response->WriteString($room->getWallpaper()); $user->Send($response->Finalize()); } if ($room->getFloor() != "0.0") { $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomSpacesMessageComposer")); $response->WriteString("floor"); $response->WriteString($room->getFloor()); $user->Send($response->Finalize()); } $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomSpacesMessageComposer")); $response->WriteString("landscape"); $response->WriteString($room->getLandscape()); $user->Send($response->Finalize()); //owner rights, TODO: check rights $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomRightsLevelMessageComposer")); $response->WriteInt32(4); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("HasOwnerRightsMessageComposer")); $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomRatingMessageComposer")); $response->WriteInt32($room->getScore()); $response->WriteBoolean(false); //can vote ? $user->Send($response->Finalize()); $response = new PacketConstructor(); $response->SetHeader($util->HeaderManager->Outgoing("RoomUpdateMessageComposer")); $response->WriteInt32($room->getId()); $user->Send($response->Finalize()); }