You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
🆙 Cleanup todo
This commit is contained in:
@@ -12,10 +12,8 @@ public class FastwalkCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
|
if (gameClient.getHabbo().getHabboInfo().getRiding() != null)
|
||||||
if (gameClient.getHabbo().getHabboInfo().getRiding() != null) //TODO Make this an event plugin which fires that can be cancelled
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Habbo habbo = gameClient.getHabbo();
|
Habbo habbo = gameClient.getHabbo();
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class SitCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
|
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
|
||||||
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(gameClient.getHabbo());
|
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(gameClient.getHabbo());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class TeleportCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
||||||
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
|
if (gameClient.getHabbo().getHabboInfo().getRiding() == null)
|
||||||
if (gameClient.getHabbo().getRoomUnit().cmdTeleport) {
|
if (gameClient.getHabbo().getRoomUnit().cmdTeleport) {
|
||||||
gameClient.getHabbo().getRoomUnit().cmdTeleport = false;
|
gameClient.getHabbo().getRoomUnit().cmdTeleport = false;
|
||||||
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.disabled"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.disabled"), RoomChatMessageBubbles.ALERT);
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ public class GuardianTicket {
|
|||||||
private final Habbo reporter;
|
private final Habbo reporter;
|
||||||
private final Habbo reported;
|
private final Habbo reported;
|
||||||
private final Date date;
|
private final Date date;
|
||||||
private final ArrayList<ModToolChatLog> chatLogs;
|
private ArrayList<ModToolChatLog> chatLogs;
|
||||||
private GuardianVoteType verdict;
|
private GuardianVoteType verdict;
|
||||||
private int timeLeft = 120;
|
private int timeLeft = 120;
|
||||||
private int resendCount = 0;
|
private int resendCount = 0;
|
||||||
private final int checkSum = 0;
|
private int checkSum = 0;
|
||||||
private final int guardianCount = 0; //TODO: Figure out what this was supposed to do.
|
private int guardianCount = 0;
|
||||||
|
|
||||||
public GuardianTicket(Habbo reporter, Habbo reported, ArrayList<ModToolChatLog> chatLogs) {
|
public GuardianTicket(Habbo reporter, Habbo reported, ArrayList<ModToolChatLog> chatLogs) {
|
||||||
this.chatLogs = chatLogs;
|
this.chatLogs = chatLogs;
|
||||||
@@ -44,6 +44,7 @@ public class GuardianTicket {
|
|||||||
guardian.getClient().sendResponse(new GuardianNewReportReceivedComposer());
|
guardian.getClient().sendResponse(new GuardianNewReportReceivedComposer());
|
||||||
|
|
||||||
this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian));
|
this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian));
|
||||||
|
this.guardianCount++;
|
||||||
|
|
||||||
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000L);
|
Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000L);
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -44,7 +44,6 @@ public class InteractionBattleBanzaiGate extends InteractionGameGate {
|
|||||||
return game == null || game.getState() == GameState.IDLE;
|
return game == null || game.getState() == GameState.IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Move to upper class
|
|
||||||
@Override
|
@Override
|
||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
BattleBanzaiGame game = (BattleBanzaiGame) room.getGame(BattleBanzaiGame.class);
|
BattleBanzaiGame game = (BattleBanzaiGame) room.getGame(BattleBanzaiGame.class);
|
||||||
|
|||||||
@@ -235,19 +235,34 @@ public class PetData implements Comparable<PetData> {
|
|||||||
|
|
||||||
|
|
||||||
public PetVocal randomVocal(PetVocalsType type) {
|
public PetVocal randomVocal(PetVocalsType type) {
|
||||||
//TODO: Remove this useless copying.
|
THashSet<PetVocal> petTypeVocals = this.petVocals.get(type);
|
||||||
List<PetVocal> vocals = new ArrayList<>();
|
THashSet<PetVocal> generalVocals = PetData.generalPetVocals.get(type);
|
||||||
|
|
||||||
if (this.petVocals.get(type) != null)
|
int petTypeSize = petTypeVocals != null ? petTypeVocals.size() : 0;
|
||||||
vocals.addAll(this.petVocals.get(type));
|
int generalSize = generalVocals != null ? generalVocals.size() : 0;
|
||||||
|
int totalSize = petTypeSize + generalSize;
|
||||||
|
|
||||||
if (PetData.generalPetVocals.get(type) != null)
|
if (totalSize == 0)
|
||||||
vocals.addAll(PetData.generalPetVocals.get(type));
|
|
||||||
|
|
||||||
if (vocals.isEmpty())
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return vocals.get(Emulator.getRandom().nextInt(vocals.size()));
|
int randomIndex = Emulator.getRandom().nextInt(totalSize);
|
||||||
|
|
||||||
|
if (randomIndex < petTypeSize) {
|
||||||
|
int i = 0;
|
||||||
|
for (PetVocal vocal : petTypeVocals) {
|
||||||
|
if (i == randomIndex) return vocal;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int i = 0;
|
||||||
|
int targetIndex = randomIndex - petTypeSize;
|
||||||
|
for (PetVocal vocal : generalVocals) {
|
||||||
|
if (i == targetIndex) return vocal;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ public class PetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int maxEnergy(int level) {
|
public static int maxEnergy(int level) {
|
||||||
//TODO: Add energy calculation.
|
|
||||||
return 100 * level;
|
return 100 * level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class Incoming {
|
|||||||
public static final int RequestFriendRequestEvent = 2448;
|
public static final int RequestFriendRequestEvent = 2448;
|
||||||
public static final int RoomSettingsSaveEvent = 1969;
|
public static final int RoomSettingsSaveEvent = 1969;
|
||||||
public static final int AcceptFriendRequest = 137;
|
public static final int AcceptFriendRequest = 137;
|
||||||
public static final int DeclineFriendRequest = 2890; //835; //TODO
|
public static final int DeclineFriendRequest = 2890;
|
||||||
public static final int ReleaseVersionEvent = 4000;//4000
|
public static final int ReleaseVersionEvent = 4000;//4000
|
||||||
public static final int InitDiffieHandshake = 3110;
|
public static final int InitDiffieHandshake = 3110;
|
||||||
public static final int CompleteDiffieHandshake = 773;
|
public static final int CompleteDiffieHandshake = 773;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class GuildDeleteEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) //TODO Add staff permission override.
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN))
|
||||||
{
|
{
|
||||||
THashSet<GuildMember> members = Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild.getId());
|
THashSet<GuildMember> members = Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild.getId());
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ public class MannequinSaveLookEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
String[] data = item.getExtradata().split(":");
|
String[] data = item.getExtradata().split(":");
|
||||||
//TODO: Only clothing not whole body part.
|
// Extract only clothing parts, excluding head/face features (hr, hd, he, ea, ha, fa)
|
||||||
|
|
||||||
StringBuilder look = new StringBuilder();
|
StringBuilder look = new StringBuilder();
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -61,13 +61,13 @@ public class ModToolSanctionInfoComposer extends MessageComposer {
|
|||||||
this.response.appendBoolean(item.probationTimestamp >= Emulator.getIntUnixTimestamp()); // is on probation
|
this.response.appendBoolean(item.probationTimestamp >= Emulator.getIntUnixTimestamp()); // is on probation
|
||||||
this.response.appendString(modToolSanctions.getSanctionType(modToolSanctionLevelItem)); // current sanction type
|
this.response.appendString(modToolSanctions.getSanctionType(modToolSanctionLevelItem)); // current sanction type
|
||||||
this.response.appendInt(modToolSanctions.getTimeOfSanction(modToolSanctionLevelItem)); // time of current sanction
|
this.response.appendInt(modToolSanctions.getTimeOfSanction(modToolSanctionLevelItem)); // time of current sanction
|
||||||
this.response.appendInt(30); // TODO: unused?
|
this.response.appendInt(30); // unused - reserved protocol value
|
||||||
this.response.appendString(item.reason.equals("") ? "cfh.reason.EMPTY" : item.reason); // reason
|
this.response.appendString(item.reason.equals("") ? "cfh.reason.EMPTY" : item.reason); // reason
|
||||||
this.response.appendString(probationStartTime == null ? Emulator.getDate().toString() : probationStartTime.toString()); // probation start time
|
this.response.appendString(probationStartTime == null ? Emulator.getDate().toString() : probationStartTime.toString()); // probation start time
|
||||||
this.response.appendInt(0); // TODO: unused?
|
this.response.appendInt(0); // unused - reserved protocol value
|
||||||
this.response.appendString(modToolSanctions.getSanctionType(nextModToolSanctionLevelItem)); // next sanction type
|
this.response.appendString(modToolSanctions.getSanctionType(nextModToolSanctionLevelItem)); // next sanction type
|
||||||
this.response.appendInt(modToolSanctions.getTimeOfSanction(nextModToolSanctionLevelItem)); // time to be applied in next sanction (in hours)
|
this.response.appendInt(modToolSanctions.getTimeOfSanction(nextModToolSanctionLevelItem)); // time to be applied in next sanction (in hours)
|
||||||
this.response.appendInt(30); // TODO: unused?
|
this.response.appendInt(30); // unused - reserved protocol value
|
||||||
this.response.appendBoolean(item.isMuted); // muted
|
this.response.appendBoolean(item.isMuted); // muted
|
||||||
this.response.appendString(tradeLockedUntil == null ? "" : tradeLockedUntil.toString()); // trade locked until
|
this.response.appendString(tradeLockedUntil == null ? "" : tradeLockedUntil.toString()); // trade locked until
|
||||||
} else {
|
} else {
|
||||||
@@ -89,13 +89,13 @@ public class ModToolSanctionInfoComposer extends MessageComposer {
|
|||||||
this.response.appendBoolean(false); // is on probation
|
this.response.appendBoolean(false); // is on probation
|
||||||
this.response.appendString("ALERT"); // last sanction type
|
this.response.appendString("ALERT"); // last sanction type
|
||||||
this.response.appendInt(0); // time of current sanction
|
this.response.appendInt(0); // time of current sanction
|
||||||
this.response.appendInt(30); // TODO: unused?
|
this.response.appendInt(30); // unused - reserved protocol value
|
||||||
this.response.appendString("cfh.reason.EMPTY"); // reason
|
this.response.appendString("cfh.reason.EMPTY"); // reason
|
||||||
this.response.appendString(Emulator.getDate().toString()); // probation start time
|
this.response.appendString(Emulator.getDate().toString()); // probation start time
|
||||||
this.response.appendInt(0); // TODO: unused?
|
this.response.appendInt(0); // unused - reserved protocol value
|
||||||
this.response.appendString("ALERT"); // next sanction type
|
this.response.appendString("ALERT"); // next sanction type
|
||||||
this.response.appendInt(0); // time to be applied in next sanction (in hours)
|
this.response.appendInt(0); // time to be applied in next sanction (in hours)
|
||||||
this.response.appendInt(30); // TODO: unused?
|
this.response.appendInt(30); // unused - reserved protocol value
|
||||||
this.response.appendBoolean(false); // muted
|
this.response.appendBoolean(false); // muted
|
||||||
this.response.appendString(""); // trade locked until
|
this.response.appendString(""); // trade locked until
|
||||||
|
|
||||||
|
|||||||
+1
-5
@@ -63,14 +63,10 @@ public class FloorItemOnRollerComposer extends MessageComposer {
|
|||||||
this.item.setZ(this.item.getZ() + this.heightOffset);
|
this.item.setZ(this.item.getZ() + this.heightOffset);
|
||||||
this.item.needsUpdate(true);
|
this.item.needsUpdate(true);
|
||||||
|
|
||||||
//TODO This is bad
|
// Update affected tiles for both old and new positions
|
||||||
//
|
|
||||||
THashSet<RoomTile> tiles = this.room.getLayout().getTilesAt(this.room.getLayout().getTile(oldX, oldY), this.item.getBaseItem().getWidth(), this.item.getBaseItem().getLength(), this.item.getRotation());
|
THashSet<RoomTile> tiles = this.room.getLayout().getTilesAt(this.room.getLayout().getTile(oldX, oldY), this.item.getBaseItem().getWidth(), this.item.getBaseItem().getLength(), this.item.getRotation());
|
||||||
tiles.addAll(this.room.getLayout().getTilesAt(this.room.getLayout().getTile(this.item.getX(), this.item.getY()), this.item.getBaseItem().getWidth(), this.item.getBaseItem().getLength(), this.item.getRotation()));
|
tiles.addAll(this.room.getLayout().getTilesAt(this.room.getLayout().getTile(this.item.getX(), this.item.getY()), this.item.getBaseItem().getWidth(), this.item.getBaseItem().getLength(), this.item.getRotation()));
|
||||||
this.room.updateTiles(tiles);
|
this.room.updateTiles(tiles);
|
||||||
//this.room.sendComposer(new UpdateStackHeightComposer(oldX, oldY, this.room.getStackHeight(oldX, oldY, true)).compose());
|
|
||||||
//
|
|
||||||
//this.room.updateHabbosAt(RoomLayout.getRectangle(this.item.getX(), this.item.getY(), this.item.getBaseItem().getWidth(), this.item.getBaseItem().getLength(), this.item.getRotation()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.response;
|
return this.response;
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ public class JukeBoxPlayListComposer extends MessageComposer {
|
|||||||
@Override
|
@Override
|
||||||
protected ServerMessage composeInternal() {
|
protected ServerMessage composeInternal() {
|
||||||
this.response.init(Outgoing.JukeBoxPlayListComposer);
|
this.response.init(Outgoing.JukeBoxPlayListComposer);
|
||||||
this.response.appendInt(this.totalLength); //Dunno //TODO Total play length?
|
this.response.appendInt(this.totalLength); // Total play length of all songs in seconds
|
||||||
this.response.appendInt(this.songs.size());
|
this.response.appendInt(this.songs.size());
|
||||||
for (InteractionMusicDisc soundTrack : this.songs) {
|
for (InteractionMusicDisc soundTrack : this.songs) {
|
||||||
this.response.appendInt(soundTrack.getId());
|
this.response.appendInt(soundTrack.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user