Project cleanup pre merge.

This commit is contained in:
2023-07-15 09:23:48 -04:00
parent 134b651df8
commit 9bbdef224d
747 changed files with 99704 additions and 101200 deletions
@@ -21,75 +21,75 @@ import engine.objects.Guild;
public class UpdateClientAlliancesMsg extends ClientNetMsg {
private int guildID;
private int guildID;
public UpdateClientAlliancesMsg(Guild guild) {
super(Protocol.UPDATECLIENTALLIANCES);
this.guildID = guild.getObjectUUID();
public UpdateClientAlliancesMsg(Guild guild) {
super(Protocol.UPDATECLIENTALLIANCES);
this.guildID = guild.getObjectUUID();
}
}
public UpdateClientAlliancesMsg() {
super(Protocol.UPDATECLIENTALLIANCES);
}
public UpdateClientAlliancesMsg() {
super(Protocol.UPDATECLIENTALLIANCES);
}
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public UpdateClientAlliancesMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.UPDATECLIENTALLIANCES, origin, reader);
}
//CALL THIS AFTER SANITY CHECKS AND BEFORE UPDATING HEALTH/GOLD.
/**
* This constructor is used by NetMsgFactory. It attempts to deserialize the
* ByteBuffer into a message. If a BufferUnderflow occurs (based on reading
* past the limit) then this constructor Throws that Exception to the
* caller.
*/
public UpdateClientAlliancesMsg(AbstractConnection origin, ByteBufferReader reader) {
super(Protocol.UPDATECLIENTALLIANCES, origin, reader);
}
//CALL THIS AFTER SANITY CHECKS AND BEFORE UPDATING HEALTH/GOLD.
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
reader.get();
}
/**
* Deserializes the subclass specific items from the supplied NetMsgReader.
*/
@Override
protected void _deserialize(ByteBufferReader reader) {
reader.getInt();
reader.getInt();
reader.getInt();
reader.getInt();
reader.get();
}
// Precache and configure this message before we serialize it
// Precache and configure this message before we serialize it
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) throws SerializationException {
/**
* Serializes the subclass specific items to the supplied NetMsgWriter.
*/
@Override
protected void _serialize(ByteBufferWriter writer) throws SerializationException {
Guild guild = Guild.getGuild(this.guildID);
Guild guild = Guild.getGuild(this.guildID);
writer.putInt(guild.getAllyList().size());
writer.putInt(guild.getAllyList().size());
for (Guild allies: guild.getAllyList()){
writer.putInt(GameObjectType.Guild.ordinal());
writer.putInt(allies.getObjectUUID());
}
for (Guild allies : guild.getAllyList()) {
writer.putInt(GameObjectType.Guild.ordinal());
writer.putInt(allies.getObjectUUID());
}
writer.putInt(guild.getEnemyList().size());
for (Guild enemies: guild.getEnemyList()){
writer.putInt(GameObjectType.Guild.ordinal());
writer.putInt(enemies.getObjectUUID());
}
writer.putInt(0);
writer.putInt(0);
writer.put((byte)1);
}
writer.putInt(guild.getEnemyList().size());
for (Guild enemies : guild.getEnemyList()) {
writer.putInt(GameObjectType.Guild.ordinal());
writer.putInt(enemies.getObjectUUID());
}
writer.putInt(0);
writer.putInt(0);
writer.put((byte) 1);
}
public int getGuildID() {
return guildID;
}
public int getGuildID() {
return guildID;
}
}