mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
UsernameEvent > GetIgnoredUsersEvent
This commit is contained in:
parent
c33e8675a8
commit
8d89f2034d
@ -782,6 +782,9 @@ public class HabboStats implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TIntArrayList getIgnoredUsers() {
|
||||||
|
return this.ignoredUsers;
|
||||||
|
}
|
||||||
public boolean userIgnored(int userId) {
|
public boolean userIgnored(int userId) {
|
||||||
return this.ignoredUsers.contains(userId);
|
return this.ignoredUsers.contains(userId);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ import com.eu.habbo.messages.incoming.rooms.promotions.UpdateRoomPromotionEvent;
|
|||||||
import com.eu.habbo.messages.incoming.rooms.users.*;
|
import com.eu.habbo.messages.incoming.rooms.users.*;
|
||||||
import com.eu.habbo.messages.incoming.trading.*;
|
import com.eu.habbo.messages.incoming.trading.*;
|
||||||
import com.eu.habbo.messages.incoming.unknown.RequestResolutionEvent;
|
import com.eu.habbo.messages.incoming.unknown.RequestResolutionEvent;
|
||||||
import com.eu.habbo.messages.incoming.unknown.UnknownEvent1;
|
import com.eu.habbo.messages.incoming.inventory.GetBadgePointLimitsEvent;
|
||||||
import com.eu.habbo.messages.incoming.users.*;
|
import com.eu.habbo.messages.incoming.users.*;
|
||||||
import com.eu.habbo.messages.incoming.wired.WiredApplySetConditionsEvent;
|
import com.eu.habbo.messages.incoming.wired.WiredApplySetConditionsEvent;
|
||||||
import com.eu.habbo.messages.incoming.wired.WiredConditionSaveDataEvent;
|
import com.eu.habbo.messages.incoming.wired.WiredConditionSaveDataEvent;
|
||||||
@ -273,7 +273,7 @@ public class PacketManager {
|
|||||||
this.registerHandler(Incoming.CompleteDiffieHandshake, CompleteDiffieHandshakeEvent.class);
|
this.registerHandler(Incoming.CompleteDiffieHandshake, CompleteDiffieHandshakeEvent.class);
|
||||||
this.registerHandler(Incoming.SecureLoginEvent, SecureLoginEvent.class);
|
this.registerHandler(Incoming.SecureLoginEvent, SecureLoginEvent.class);
|
||||||
this.registerHandler(Incoming.MachineIDEvent, MachineIDEvent.class);
|
this.registerHandler(Incoming.MachineIDEvent, MachineIDEvent.class);
|
||||||
this.registerHandler(Incoming.UsernameEvent, UsernameEvent.class);
|
this.registerHandler(Incoming.GetIgnoredUsersEvent, GetIgnoredUsersEvent.class);
|
||||||
this.registerHandler(Incoming.PingEvent, PingEvent.class);
|
this.registerHandler(Incoming.PingEvent, PingEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ public class PacketManager {
|
|||||||
void registerUnknown() throws Exception {
|
void registerUnknown() throws Exception {
|
||||||
this.registerHandler(Incoming.RequestResolutionEvent, RequestResolutionEvent.class);
|
this.registerHandler(Incoming.RequestResolutionEvent, RequestResolutionEvent.class);
|
||||||
this.registerHandler(Incoming.RequestTalenTrackEvent, RequestTalentTrackEvent.class);
|
this.registerHandler(Incoming.RequestTalenTrackEvent, RequestTalentTrackEvent.class);
|
||||||
this.registerHandler(Incoming.UnknownEvent1, UnknownEvent1.class);
|
this.registerHandler(Incoming.BadgePointLimitsEvent, GetBadgePointLimitsEvent.class);
|
||||||
this.registerHandler(Incoming.MySanctionStatusEvent, MySanctionStatusEvent.class);
|
this.registerHandler(Incoming.MySanctionStatusEvent, MySanctionStatusEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ public class Incoming {
|
|||||||
public static final int FloorPlanEditorSaveEvent = 875;
|
public static final int FloorPlanEditorSaveEvent = 875;
|
||||||
public static final int FloorPlanEditorRequestDoorSettingsEvent = 3559;
|
public static final int FloorPlanEditorRequestDoorSettingsEvent = 3559;
|
||||||
public static final int FloorPlanEditorRequestBlockedTilesEvent = 1687;
|
public static final int FloorPlanEditorRequestBlockedTilesEvent = 1687;
|
||||||
public static final int UnknownEvent1 = 1371;
|
public static final int BadgePointLimitsEvent = 1371;
|
||||||
public static final int RequestTalenTrackEvent = 196;
|
public static final int RequestTalenTrackEvent = 196;
|
||||||
public static final int RequestNewNavigatorDataEvent = 2110;
|
public static final int RequestNewNavigatorDataEvent = 2110;
|
||||||
public static final int RequestNewNavigatorRoomsEvent = 249;
|
public static final int RequestNewNavigatorRoomsEvent = 249;
|
||||||
@ -227,7 +227,7 @@ public class Incoming {
|
|||||||
public static final int MoodLightSaveSettingsEvent = 1648;
|
public static final int MoodLightSaveSettingsEvent = 1648;
|
||||||
public static final int ModToolRequestIssueChatlogEvent = 211;
|
public static final int ModToolRequestIssueChatlogEvent = 211;
|
||||||
public static final int ModToolRequestRoomUserChatlogEvent = -1;
|
public static final int ModToolRequestRoomUserChatlogEvent = -1;
|
||||||
public static final int UsernameEvent = 3878;
|
public static final int GetIgnoredUsersEvent = 3878;
|
||||||
public static final int RequestClubGiftsEvent = 487;
|
public static final int RequestClubGiftsEvent = 487;
|
||||||
public static final int RentSpaceEvent = 2946;
|
public static final int RentSpaceEvent = 2946;
|
||||||
public static final int RentSpaceCancelEvent = 1667;
|
public static final int RentSpaceCancelEvent = 1667;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package com.eu.habbo.messages.incoming.achievements;
|
package com.eu.habbo.messages.incoming.achievements;
|
||||||
|
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
import com.eu.habbo.messages.outgoing.inventory.InventoryAchievementsComposer;
|
import com.eu.habbo.messages.outgoing.inventory.BadgePointLimitsComposer;
|
||||||
|
|
||||||
public class RequestAchievementConfigurationEvent extends MessageHandler {
|
public class RequestAchievementConfigurationEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() throws Exception {
|
public void handle() throws Exception {
|
||||||
this.client.sendResponse(new InventoryAchievementsComposer());
|
this.client.sendResponse(new BadgePointLimitsComposer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,112 +0,0 @@
|
|||||||
package com.eu.habbo.messages.incoming.handshake;
|
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
|
||||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
|
||||||
import com.eu.habbo.habbohotel.campaign.calendar.CalendarCampaign;
|
|
||||||
import com.eu.habbo.habbohotel.catalog.TargetOffer;
|
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
|
||||||
import com.eu.habbo.messages.outgoing.catalog.TargetedOfferComposer;
|
|
||||||
import com.eu.habbo.messages.outgoing.events.calendar.AdventCalendarDataComposer;
|
|
||||||
import com.eu.habbo.messages.outgoing.habboway.nux.NuxAlertComposer;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.time.temporal.ChronoUnit;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import static java.time.temporal.ChronoUnit.DAYS;
|
|
||||||
|
|
||||||
public class UsernameEvent extends MessageHandler {
|
|
||||||
@Override
|
|
||||||
public void handle() throws Exception {
|
|
||||||
boolean calendar = false;
|
|
||||||
if (!this.client.getHabbo().getHabboStats().getAchievementProgress().containsKey(Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login"))) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login"));
|
|
||||||
calendar = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
long daysBetween = DAYS.between(new Date((long) this.client.getHabbo().getHabboInfo().getLastOnline() * 1000L).toInstant(), new Date().toInstant());
|
|
||||||
|
|
||||||
|
|
||||||
Date lastLogin = new Date(this.client.getHabbo().getHabboInfo().getLastOnline());
|
|
||||||
Calendar c1 = Calendar.getInstance();
|
|
||||||
c1.add(Calendar.DAY_OF_YEAR, -1);
|
|
||||||
|
|
||||||
Calendar c2 = Calendar.getInstance();
|
|
||||||
c2.setTime(lastLogin);
|
|
||||||
|
|
||||||
if (daysBetween == 1) {
|
|
||||||
if (this.client.getHabbo().getHabboStats().getAchievementProgress().get(Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login")) == this.client.getHabbo().getHabboStats().loginStreak) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login"));
|
|
||||||
}
|
|
||||||
this.client.getHabbo().getHabboStats().loginStreak++;
|
|
||||||
calendar = true;
|
|
||||||
} else if (daysBetween >= 1) {
|
|
||||||
calendar = true;
|
|
||||||
} else {
|
|
||||||
if (((lastLogin.getTime() / 1000) - Emulator.getIntUnixTimestamp()) > 86400) {
|
|
||||||
this.client.getHabbo().getHabboStats().loginStreak = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.client.getHabbo().getHabboStats().getAchievementProgress().containsKey(Emulator.getGameEnvironment().getAchievementManager().getAchievement("RegistrationDuration"))) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RegistrationDuration"), 0);
|
|
||||||
} else {
|
|
||||||
int daysRegistered = ((Emulator.getIntUnixTimestamp() - this.client.getHabbo().getHabboInfo().getAccountCreated()) / 86400);
|
|
||||||
|
|
||||||
int days = this.client.getHabbo().getHabboStats().getAchievementProgress(
|
|
||||||
Emulator.getGameEnvironment().getAchievementManager().getAchievement("RegistrationDuration")
|
|
||||||
);
|
|
||||||
|
|
||||||
if (daysRegistered - days > 0) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("RegistrationDuration"), daysRegistered - days);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.client.getHabbo().getHabboStats().getAchievementProgress().containsKey(Emulator.getGameEnvironment().getAchievementManager().getAchievement("TraderPass"))) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("TraderPass"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement achievementQueueStatement = connection.prepareStatement("SELECT * FROM users_achievements_queue WHERE user_id = ?")) {
|
|
||||||
achievementQueueStatement.setInt(1, this.client.getHabbo().getHabboInfo().getId());
|
|
||||||
|
|
||||||
try (ResultSet achievementSet = achievementQueueStatement.executeQuery()) {
|
|
||||||
while (achievementSet.next()) {
|
|
||||||
AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement(achievementSet.getInt("achievement_id")), achievementSet.getInt("amount"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try (PreparedStatement deleteStatement = connection.prepareStatement("DELETE FROM users_achievements_queue WHERE user_id = ?")) {
|
|
||||||
deleteStatement.setInt(1, this.client.getHabbo().getHabboInfo().getId());
|
|
||||||
deleteStatement.execute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
|
|
||||||
CalendarCampaign campaign = Emulator.getGameEnvironment().getCalendarManager().getCalendarCampaign(Emulator.getConfig().getValue("hotel.calendar.default"));
|
|
||||||
if(campaign != null){
|
|
||||||
long daysBetween = DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
|
||||||
if(daysBetween >= 0) {
|
|
||||||
this.client.sendResponse(new AdventCalendarDataComposer(campaign.getName(), campaign.getImage(), campaign.getTotalDays(), (int) daysBetween, this.client.getHabbo().getHabboStats().calendarRewardsClaimed, campaign.getLockExpired()));
|
|
||||||
this.client.sendResponse(new NuxAlertComposer("openView/calendar"));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TargetOffer.ACTIVE_TARGET_OFFER_ID > 0) {
|
|
||||||
TargetOffer offer = Emulator.getGameEnvironment().getCatalogManager().getTargetOffer(TargetOffer.ACTIVE_TARGET_OFFER_ID);
|
|
||||||
|
|
||||||
if (offer != null) {
|
|
||||||
this.client.sendResponse(new TargetedOfferComposer(this.client.getHabbo(), offer));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.client.getHabbo().getHabboInfo().setLastOnline(Emulator.getIntUnixTimestamp());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
package com.eu.habbo.messages.incoming.unknown;
|
|
||||||
|
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
|
||||||
import com.eu.habbo.messages.outgoing.unknown.IgnoredUsersComposer;
|
|
||||||
|
|
||||||
public class UnknownEvent1 extends MessageHandler {
|
|
||||||
@Override
|
|
||||||
public void handle() throws Exception {
|
|
||||||
this.client.sendResponse(new IgnoredUsersComposer());
|
|
||||||
}
|
|
||||||
}
|
|
@ -48,8 +48,8 @@ public class Outgoing {
|
|||||||
public final static int InventoryBadgesComposer = 717;
|
public final static int InventoryBadgesComposer = 717;
|
||||||
public final static int UserTypingMessageComposer = 1717;
|
public final static int UserTypingMessageComposer = 1717;
|
||||||
public final static int GuildJoinErrorComposer = 762;
|
public final static int GuildJoinErrorComposer = 762;
|
||||||
public final static int UserFlatCatsComposer = 1562;
|
public final static int RoomCategoriesComposer = 1562;
|
||||||
public final static int InventoryAchievementsComposer = 2501;
|
public final static int BadgePointLimitsComposer = 2501;
|
||||||
public final static int MarketplaceItemInfoComposer = 725;
|
public final static int MarketplaceItemInfoComposer = 725;
|
||||||
public final static int RoomRelativeMapComposer = 2753;
|
public final static int RoomRelativeMapComposer = 2753;
|
||||||
public final static int ModeratorActionResultMessageComposer = 2335;
|
public final static int ModeratorActionResultMessageComposer = 2335;
|
||||||
|
@ -4,10 +4,21 @@ import com.eu.habbo.messages.ServerMessage;
|
|||||||
import com.eu.habbo.messages.outgoing.MessageComposer;
|
import com.eu.habbo.messages.outgoing.MessageComposer;
|
||||||
import com.eu.habbo.messages.outgoing.Outgoing;
|
import com.eu.habbo.messages.outgoing.Outgoing;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class IgnoredUsersComposer extends MessageComposer {
|
public class IgnoredUsersComposer extends MessageComposer {
|
||||||
|
|
||||||
|
ArrayList<String> ignoredUsers;
|
||||||
|
|
||||||
|
public IgnoredUsersComposer(ArrayList<String> ignoredUsers) {
|
||||||
|
this.ignoredUsers = ignoredUsers;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.IgnoredUsersMessageComposer);
|
|
||||||
|
}
|
||||||
|
this.response.init(Outgoing.IgnoredUsersComposer);
|
||||||
this.response.appendInt(0);
|
this.response.appendInt(0);
|
||||||
return this.response;
|
return this.response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user