Initial Repository Push
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.net.client.msg;
|
||||
|
||||
import engine.Enum.RealmType;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.Protocol;
|
||||
import engine.objects.Realm;
|
||||
|
||||
|
||||
public class WorldRealmMsg extends ClientNetMsg {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public WorldRealmMsg() {
|
||||
super(Protocol.REALMDATA);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 WorldRealmMsg(AbstractConnection origin, ByteBufferReader reader) {
|
||||
super(Protocol.REALMDATA, origin, reader);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerOfTwoBufferSize() {
|
||||
return (14); // 2^14 == 16384
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes the subclass specific items to the supplied NetMsgWriter.
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected void _serialize(ByteBufferWriter writer) {
|
||||
|
||||
int realmCount;
|
||||
int realmID;
|
||||
Realm serverRealm;
|
||||
|
||||
|
||||
realmCount = RealmType.values().length - 1;
|
||||
// Realm count without seafloor
|
||||
|
||||
writer.putInt(realmCount);
|
||||
|
||||
for (RealmType realmType : RealmType.values()) {
|
||||
|
||||
realmID = realmType.getRealmID();
|
||||
// Don't serialize seafloor
|
||||
|
||||
if (realmID == 0)
|
||||
continue;
|
||||
|
||||
serverRealm = Realm.getRealm(realmID);
|
||||
serverRealm.serializeForClientMsg(writer);
|
||||
|
||||
}
|
||||
|
||||
writer.putInt(0x0);
|
||||
writer.putInt(3000000);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the subclass specific items from the supplied NetMsgReader.
|
||||
*/
|
||||
@Override
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
// TODO Implement Deserialization
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user