mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Set lastonline on habbo.java
This commit is contained in:
parent
d7e059326e
commit
c33e8675a8
@ -145,6 +145,8 @@ public class Habbo implements Runnable {
|
|||||||
|
|
||||||
this.habboInfo.setMachineID(this.client.getMachineId());
|
this.habboInfo.setMachineID(this.client.getMachineId());
|
||||||
this.isOnline(true);
|
this.isOnline(true);
|
||||||
|
this.habboStats.cache.put("previousOnline", this.habboInfo.getLastOnline());
|
||||||
|
this.habboInfo.setLastOnline(Emulator.getIntUnixTimestamp());
|
||||||
|
|
||||||
this.messenger.connectionChanged(this, true, false);
|
this.messenger.connectionChanged(this, true, false);
|
||||||
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.eu.habbo.messages.incoming.inventory;
|
||||||
|
|
||||||
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
|
import com.eu.habbo.messages.outgoing.inventory.BadgePointLimitsComposer;
|
||||||
|
|
||||||
|
public class GetBadgePointLimitsEvent extends MessageHandler {
|
||||||
|
@Override
|
||||||
|
public void handle() throws Exception {
|
||||||
|
this.client.sendResponse(new BadgePointLimitsComposer());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.eu.habbo.messages.incoming.users;
|
||||||
|
|
||||||
|
import com.eu.habbo.Emulator;
|
||||||
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||||
|
import com.eu.habbo.habbohotel.users.HabboManager;
|
||||||
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
|
import com.eu.habbo.messages.outgoing.unknown.IgnoredUsersComposer;
|
||||||
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class GetIgnoredUsersEvent extends MessageHandler {
|
||||||
|
|
||||||
|
ArrayList<String> ignoredUsernames = new ArrayList<>();
|
||||||
|
@Override
|
||||||
|
public void handle() throws Exception {
|
||||||
|
Habbo habbo = this.client.getHabbo();
|
||||||
|
if(habbo == null) return;
|
||||||
|
|
||||||
|
TIntArrayList ignoredUsersId = habbo.getHabboStats().getIgnoredUsers();
|
||||||
|
|
||||||
|
if (ignoredUsersId.size() > 0) {
|
||||||
|
int userId = ignoredUsersId.iterator().next();
|
||||||
|
|
||||||
|
HabboInfo user = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
||||||
|
if(user == null) user = HabboManager.getOfflineHabboInfo(userId);
|
||||||
|
if(user != null) ignoredUsernames.add(user.getUsername());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.client.sendResponse(new IgnoredUsersComposer(ignoredUsernames));
|
||||||
|
}
|
||||||
|
}
|
@ -9,10 +9,10 @@ import com.eu.habbo.messages.outgoing.Outgoing;
|
|||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
import gnu.trove.procedure.TObjectProcedure;
|
import gnu.trove.procedure.TObjectProcedure;
|
||||||
|
|
||||||
public class InventoryAchievementsComposer extends MessageComposer {
|
public class BadgePointLimitsComposer extends MessageComposer {
|
||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.InventoryAchievementsComposer);
|
this.response.init(Outgoing.BadgePointLimitsComposer);
|
||||||
|
|
||||||
synchronized (Emulator.getGameEnvironment().getAchievementManager().getAchievements()) {
|
synchronized (Emulator.getGameEnvironment().getAchievementManager().getAchievements()) {
|
||||||
THashMap<String, Achievement> achievements = Emulator.getGameEnvironment().getAchievementManager().getAchievements();
|
THashMap<String, Achievement> achievements = Emulator.getGameEnvironment().getAchievementManager().getAchievements();
|
||||||
@ -21,12 +21,12 @@ public class InventoryAchievementsComposer extends MessageComposer {
|
|||||||
achievements.forEachValue(new TObjectProcedure<Achievement>() {
|
achievements.forEachValue(new TObjectProcedure<Achievement>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(Achievement achievement) {
|
public boolean execute(Achievement achievement) {
|
||||||
InventoryAchievementsComposer.this.response.appendString((achievement.name.startsWith("ACH_") ? achievement.name.replace("ACH_", "") : achievement.name));
|
BadgePointLimitsComposer.this.response.appendString((achievement.name.startsWith("ACH_") ? achievement.name.replace("ACH_", "") : achievement.name));
|
||||||
InventoryAchievementsComposer.this.response.appendInt(achievement.levels.size());
|
BadgePointLimitsComposer.this.response.appendInt(achievement.levels.size());
|
||||||
|
|
||||||
for (AchievementLevel level : achievement.levels.values()) {
|
for (AchievementLevel level : achievement.levels.values()) {
|
||||||
InventoryAchievementsComposer.this.response.appendInt(level.level);
|
BadgePointLimitsComposer.this.response.appendInt(level.level);
|
||||||
InventoryAchievementsComposer.this.response.appendInt(level.progress);
|
BadgePointLimitsComposer.this.response.appendInt(level.progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
Loading…
Reference in New Issue
Block a user