You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
🆙 Stage 1 New wired
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
CREATE TABLE `catalog_items_bc` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`item_ids` varchar(666) NOT NULL,
|
||||
`page_id` int(11) NOT NULL,
|
||||
`catalog_name` varchar(100) NOT NULL,
|
||||
`order_number` int(11) NOT NULL DEFAULT 1,
|
||||
`extradata` varchar(500) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;
|
||||
|
||||
CREATE TABLE `catalog_pages_bc` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`parent_id` int(11) NOT NULL DEFAULT -1,
|
||||
`caption` varchar(128) NOT NULL,
|
||||
`page_layout` enum('default_3x3','club_buy','club_gift','frontpage','spaces','recycler','recycler_info','recycler_prizes','trophies','plasto','marketplace','marketplace_own_items','spaces_new','soundmachine','guilds','guild_furni','info_duckets','info_rentables','info_pets','roomads','single_bundle','sold_ltd_items','badge_display','bots','pets','pets2','pets3','productpage1','room_bundle','recent_purchases','default_3x3_color_grouping','guild_forum','vip_buy','info_loyalty','loyalty_vip_buy','collectibles','petcustomization','frontpage_featured') NOT NULL DEFAULT 'default_3x3',
|
||||
`icon_color` int(11) NOT NULL DEFAULT 1,
|
||||
`icon_image` int(11) NOT NULL DEFAULT 1,
|
||||
`order_num` int(11) NOT NULL DEFAULT 1,
|
||||
`visible` enum('0','1') NOT NULL DEFAULT '1',
|
||||
`enabled` enum('0','1') NOT NULL DEFAULT '1',
|
||||
`page_headline` varchar(1024) NOT NULL DEFAULT '',
|
||||
`page_teaser` varchar(64) NOT NULL DEFAULT '',
|
||||
`page_special` varchar(2048) DEFAULT '' COMMENT 'Gold Bubble: catalog_special_txtbg1 // Speech Bubble: catalog_special_txtbg2 // Place normal text in page_text_teaser',
|
||||
`page_text1` text DEFAULT NULL,
|
||||
`page_text2` text DEFAULT NULL,
|
||||
`page_text_details` text DEFAULT NULL,
|
||||
`page_text_teaser` text DEFAULT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC;
|
||||
@@ -831,17 +831,36 @@ public class CatalogManager {
|
||||
|
||||
public CatalogPage createCatalogPage(String caption, String captionSave, int roomId, int icon, CatalogPageLayouts layout, int minRank, int parentId, CatalogPageType pageType, CatalogPageType catalogMode) {
|
||||
CatalogPage catalogPage = null;
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO catalog_pages (parent_id, caption, caption_save, icon_image, visible, enabled, min_rank, page_layout, room_id, includes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {
|
||||
boolean buildersClubPage = (pageType == CatalogPageType.BUILDER);
|
||||
String insertQuery = buildersClubPage
|
||||
? "INSERT INTO catalog_pages_bc (parent_id, caption, page_layout, icon_color, icon_image, order_num, visible, enabled) VALUES (?, ?, ?, ?, ?, ?, ?, ?)"
|
||||
: "INSERT INTO catalog_pages (parent_id, caption, caption_save, icon_image, visible, enabled, min_rank, page_layout, room_id, catalog_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
|
||||
String selectQuery = buildersClubPage
|
||||
? "SELECT id, parent_id, caption, caption AS caption_save, page_layout, icon_color, icon_image, 1 AS min_rank, order_num, visible, enabled, '0' AS club_only, 'BUILDERS_CLUB' AS catalog_mode, page_headline, page_teaser, page_special, page_text1, page_text2, page_text_details, page_text_teaser, '' AS includes FROM catalog_pages_bc WHERE id = ?"
|
||||
: "SELECT * FROM catalog_pages WHERE id = ?";
|
||||
|
||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection();
|
||||
PreparedStatement statement = connection.prepareStatement(insertQuery, Statement.RETURN_GENERATED_KEYS)) {
|
||||
statement.setInt(1, parentId);
|
||||
statement.setString(2, caption);
|
||||
statement.setString(3, captionSave);
|
||||
statement.setInt(4, icon);
|
||||
statement.setString(5, "1");
|
||||
statement.setString(6, "1");
|
||||
statement.setInt(7, minRank);
|
||||
statement.setString(8, layout.name());
|
||||
statement.setInt(9, roomId);
|
||||
statement.setString(10, "");
|
||||
|
||||
if (buildersClubPage) {
|
||||
statement.setString(3, layout.name());
|
||||
statement.setInt(4, 1);
|
||||
statement.setInt(5, icon);
|
||||
statement.setInt(6, 1);
|
||||
statement.setString(7, "1");
|
||||
statement.setString(8, "1");
|
||||
} else {
|
||||
statement.setString(3, captionSave);
|
||||
statement.setInt(4, icon);
|
||||
statement.setString(5, "1");
|
||||
statement.setString(6, "1");
|
||||
statement.setInt(7, minRank);
|
||||
statement.setString(8, layout.name());
|
||||
statement.setInt(9, roomId);
|
||||
statement.setString(10, catalogMode.name());
|
||||
}
|
||||
statement.execute();
|
||||
try (ResultSet set = statement.getGeneratedKeys()) {
|
||||
if (set.next()) {
|
||||
@@ -1117,7 +1136,7 @@ public class CatalogManager {
|
||||
if (extradata.length() > Emulator.getConfig().getInt("hotel.trophies.length.max", 300)) {
|
||||
extradata = extradata.substring(0, Emulator.getConfig().getInt("hotel.trophies.length.max", 300));
|
||||
}
|
||||
|
||||
|
||||
extradata = habbo.getClient().getHabbo().getHabboInfo().getUsername() + (char) 9 + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "-" + (Calendar.getInstance().get(Calendar.MONTH) + 1) + "-" + Calendar.getInstance().get(Calendar.YEAR) + (char) 9 + Emulator.getGameEnvironment().getWordFilter().filter(extradata.replace(((char) 9) + "", ""), habbo);
|
||||
}
|
||||
|
||||
@@ -1186,7 +1205,7 @@ public class CatalogManager {
|
||||
|
||||
if (badgeFound && item.getBaseItems().size() == 1) {
|
||||
habbo.getClient().sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.ALREADY_HAVE_BADGE));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
UserCatalogItemPurchasedEvent purchasedEvent = new UserCatalogItemPurchasedEvent(habbo, item, itemsList, totalCredits, totalPoints, badges);
|
||||
|
||||
@@ -190,9 +190,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
private volatile boolean muted;
|
||||
private RoomSpecialTypes roomSpecialTypes;
|
||||
private TraxManager traxManager;
|
||||
|
||||
// YouTube room broadcast state: tracks the current video being broadcast
|
||||
// by the room owner, the owner's playlist, and which users have the player open.
|
||||
private final Object wiredSettingsLock = new Object();
|
||||
private volatile boolean wiredSettingsLoaded;
|
||||
private int wiredInspectMask = WIRED_ACCESS_DEFAULT_INSPECT_MASK;
|
||||
private int wiredModifyMask = WIRED_ACCESS_DEFAULT_MODIFY_MASK;
|
||||
private boolean youtubeEnabled = false;
|
||||
private String youtubeCurrentVideo = "";
|
||||
private String youtubeSenderName = "";
|
||||
|
||||
Reference in New Issue
Block a user