Reformat and clean up "tools" package
This commit is contained in:
@@ -19,9 +19,9 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* CField_Wedding, CField_WeddingPhoto, CWeddingMan, OnMarriageResult, and all Wedding/Marriage enum/structs.
|
||||
*
|
||||
*
|
||||
* @author Eric
|
||||
*
|
||||
* <p>
|
||||
* Wishlists edited by Drago (Dragohe4rt)
|
||||
*/
|
||||
public class WeddingPackets extends PacketCreator {
|
||||
@@ -48,24 +48,24 @@ public class WeddingPackets extends PacketCreator {
|
||||
00000100 m_bStartWeddingCeremony dd ?
|
||||
00000104 CWeddingMan ends
|
||||
*/
|
||||
|
||||
|
||||
public class Field_Wedding {
|
||||
public int m_nNoticeCount;
|
||||
public int m_nCurrentStep;
|
||||
public int m_nBlessStartTime;
|
||||
}
|
||||
|
||||
|
||||
public class Field_WeddingPhoto {
|
||||
public boolean m_bPictureTook;
|
||||
}
|
||||
|
||||
|
||||
public class GW_WeddingReservation {
|
||||
public int dwReservationNo;
|
||||
public int dwGroom, dwBride;
|
||||
public String sGroomName, sBrideName;
|
||||
public int usWeddingType;
|
||||
}
|
||||
|
||||
|
||||
public class WeddingWishList {
|
||||
public Character pUser;
|
||||
public int dwMarriageNo;
|
||||
@@ -76,29 +76,30 @@ public class WeddingPackets extends PacketCreator {
|
||||
public int usModifiedFlag; // dword
|
||||
public boolean bLoaded;
|
||||
}
|
||||
|
||||
|
||||
public class GW_WeddingWishList {
|
||||
public final int WEDDINGWL_MAX = 0xA; // enum WEDDINGWL
|
||||
public int dwReservationNo;
|
||||
public byte nGender;
|
||||
public String sItemName;
|
||||
}
|
||||
|
||||
|
||||
public enum MarriageStatus {
|
||||
SINGLE(0x0),
|
||||
ENGAGED(0x1),
|
||||
RESERVED(0x2),
|
||||
MARRIED(0x3);
|
||||
private int ms;
|
||||
private MarriageStatus(int ms) {
|
||||
private final int ms;
|
||||
|
||||
MarriageStatus(int ms) {
|
||||
this.ms = ms;
|
||||
}
|
||||
|
||||
|
||||
public int getMarriageStatus() {
|
||||
return ms;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum MarriageRequest {
|
||||
AddMarriageRecord(0x0),
|
||||
SetMarriageRecord(0x1),
|
||||
@@ -107,16 +108,17 @@ public class WeddingPackets extends PacketCreator {
|
||||
AddReservation(0x4),
|
||||
DeleteReservation(0x5),
|
||||
GetReservation(0x6);
|
||||
private int req;
|
||||
private MarriageRequest(int req) {
|
||||
private final int req;
|
||||
|
||||
MarriageRequest(int req) {
|
||||
this.req = req;
|
||||
}
|
||||
|
||||
|
||||
public int getMarriageRequest() {
|
||||
return req;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum WeddingType {
|
||||
CATHEDRAL(0x1),
|
||||
VEGAS(0x2),
|
||||
@@ -124,32 +126,34 @@ public class WeddingPackets extends PacketCreator {
|
||||
CATHEDRAL_NORMAL(0xB),
|
||||
VEGAS_PREMIUM(0x14),
|
||||
VEGAS_NORMAL(0x15);
|
||||
private int wt;
|
||||
private WeddingType(int wt) {
|
||||
private final int wt;
|
||||
|
||||
WeddingType(int wt) {
|
||||
this.wt = wt;
|
||||
}
|
||||
|
||||
|
||||
public int getType() {
|
||||
return wt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum WeddingMap {
|
||||
WEDDINGTOWN(680000000),
|
||||
CHAPEL_STARTMAP(680000110),
|
||||
CATHEDRAL_STARTMAP(680000210),
|
||||
PHOTOMAP(680000300),
|
||||
EXITMAP(680000500);
|
||||
private int wm;
|
||||
private WeddingMap(int wm) {
|
||||
private final int wm;
|
||||
|
||||
WeddingMap(int wm) {
|
||||
this.wm = wm;
|
||||
}
|
||||
|
||||
|
||||
public int getMap() {
|
||||
return wm;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public enum WeddingItem {
|
||||
WR_MOONSTONE(1112803), // Wedding Ring
|
||||
WR_STARGEM(1112806),
|
||||
@@ -182,22 +186,23 @@ public class WeddingPackets extends PacketCreator {
|
||||
WT_VEGAS_NORMAL(5251001),
|
||||
WT_VEGAS_PREMIUM(5251002),
|
||||
WT_CATHEDRAL_PREMIUM(5251003);
|
||||
private int wi;
|
||||
private WeddingItem(int wi) {
|
||||
private final int wi;
|
||||
|
||||
WeddingItem(int wi) {
|
||||
this.wi = wi;
|
||||
}
|
||||
|
||||
|
||||
public int getItem() {
|
||||
return wi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <name> has requested engagement. Will you accept this proposal?
|
||||
*
|
||||
* @param name
|
||||
* @param playerid
|
||||
* @return mplew
|
||||
*
|
||||
* @param name
|
||||
* @param playerid
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet onMarriageRequest(String name, int playerid) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.MARRIAGE_REQUEST);
|
||||
@@ -206,7 +211,7 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeInt(playerid); // playerid
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A quick rundown of how (I think based off of enough BMS searching) WeddingPhoto_OnTakePhoto works:
|
||||
* - We send this packet with (first) the Groom / Bride IGNs
|
||||
@@ -217,15 +222,15 @@ public class WeddingPackets extends PacketCreator {
|
||||
* - Finally, after encoding all of our data, we send this packet out to a MapGen application server
|
||||
* - The MapGen server will then retrieve the packet byte array and convert the bytes into a ImageIO 2D JPG output
|
||||
* - The result after converting into a JPG will then be remotely uploaded to /weddings/ with ReservedGroomName_ReservedBrideName to be displayed on the web server.
|
||||
*
|
||||
* <p>
|
||||
* - Will no longer continue Wedding Photos, needs a WvsMapGen :(
|
||||
*
|
||||
* @param ReservedGroomName The groom IGN of the wedding
|
||||
* @param ReservedBrideName The bride IGN of the wedding
|
||||
* @param m_dwField The current field id (the id of the cake map, ex. 680000300)
|
||||
* @param m_uCount The current user count (equal to m_dwUsers.size)
|
||||
* @param m_dwUsers The List of all Character guests within the current cake map to be encoded
|
||||
* @return mplew (MaplePacket) Byte array to be converted and read for byte[]->ImageIO
|
||||
*
|
||||
* @param ReservedGroomName The groom IGN of the wedding
|
||||
* @param ReservedBrideName The bride IGN of the wedding
|
||||
* @param m_dwField The current field id (the id of the cake map, ex. 680000300)
|
||||
* @param m_uCount The current user count (equal to m_dwUsers.size)
|
||||
* @param m_dwUsers The List of all Character guests within the current cake map to be encoded
|
||||
* @return mplew (MaplePacket) Byte array to be converted and read for byte[]->ImageIO
|
||||
*/
|
||||
public static Packet onTakePhoto(String ReservedGroomName, String ReservedBrideName, int m_dwField, List<Character> m_dwUsers) { // OnIFailedAtWeddingPhotos
|
||||
OutPacket p = OutPacket.create(SendOpcode.WEDDING_PHOTO);// v53 header, convert -> v83
|
||||
@@ -233,7 +238,7 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeString(ReservedBrideName);
|
||||
p.writeInt(m_dwField); // field id?
|
||||
p.writeInt(m_dwUsers.size());
|
||||
|
||||
|
||||
for (Character guest : m_dwUsers) {
|
||||
// Begin Avatar Encoding
|
||||
addCharLook(p, guest, false); // CUser::EncodeAvatar
|
||||
@@ -256,17 +261,17 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeShort(guest.getPosition().y); // m_ptCurPos.y
|
||||
p.writeByte(guest.getStance()); // guest.m_bMoveAction
|
||||
}
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enable spouse chat and their engagement ring without @relog
|
||||
*
|
||||
* @param marriageId
|
||||
* @param chr
|
||||
* @param wedding
|
||||
* @return mplew
|
||||
*
|
||||
* @param marriageId
|
||||
* @param chr
|
||||
* @param wedding
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet OnMarriageResult(int marriageId, Character chr, boolean wedding) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.MARRIAGE_RESULT);
|
||||
@@ -284,15 +289,15 @@ public class WeddingPackets extends PacketCreator {
|
||||
}
|
||||
p.writeFixedString(StringUtil.getRightPaddedStr(chr.getGender() == 0 ? chr.getName() : Character.getNameById(chr.getPartnerId()), '\0', 13));
|
||||
p.writeFixedString(StringUtil.getRightPaddedStr(chr.getGender() == 0 ? Character.getNameById(chr.getPartnerId()) : chr.getName(), '\0', 13));
|
||||
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To exit the Engagement Window (Waiting for her response...), we send a GMS-like pop-up.
|
||||
*
|
||||
* @param msg
|
||||
* @return mplew
|
||||
*
|
||||
* @param msg
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet OnMarriageResult(final byte msg) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.MARRIAGE_RESULT);
|
||||
@@ -303,13 +308,13 @@ public class WeddingPackets extends PacketCreator {
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The World Map includes 'loverPos' in which this packet controls
|
||||
*
|
||||
* @param partner
|
||||
* @param mapid
|
||||
* @return mplew
|
||||
*
|
||||
* @param partner
|
||||
* @param mapid
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet OnNotifyWeddingPartnerTransfer(int partner, int mapid) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.NOTIFY_MARRIED_PARTNER_MAP_TRANSFER);
|
||||
@@ -317,17 +322,17 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeInt(partner);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The wedding packet to display Pelvis Bebop and enable the Wedding Ceremony Effect between two characters
|
||||
* CField_Wedding::OnWeddingProgress - Stages
|
||||
* CField_Wedding::OnWeddingCeremonyEnd - Wedding Ceremony Effect
|
||||
*
|
||||
* @param setBlessEffect
|
||||
* @param groom
|
||||
* @param bride
|
||||
* @param step
|
||||
* @return mplew
|
||||
*
|
||||
* @param setBlessEffect
|
||||
* @param groom
|
||||
* @param bride
|
||||
* @param step
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet OnWeddingProgress(boolean setBlessEffect, int groom, int bride, byte step) {
|
||||
OutPacket p = OutPacket.create(setBlessEffect ? SendOpcode.WEDDING_CEREMONY_END : SendOpcode.WEDDING_PROGRESS);
|
||||
@@ -338,13 +343,13 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeInt(bride);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* When we open a Wedding Invitation, we display the Bride & Groom
|
||||
*
|
||||
* @param groom
|
||||
* @param bride
|
||||
* @return mplew
|
||||
*
|
||||
* @param groom
|
||||
* @param bride
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet sendWeddingInvitation(String groom, String bride) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.MARRIAGE_RESULT);
|
||||
@@ -354,7 +359,7 @@ public class WeddingPackets extends PacketCreator {
|
||||
p.writeShort(1); // 0 = Cathedral Normal?, 1 = Cathedral Premium?, 2 = Chapel Normal?
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
public static Packet sendWishList() { // fuck my life
|
||||
OutPacket p = OutPacket.create(SendOpcode.MARRIAGE_REQUEST);
|
||||
p.writeByte(9);
|
||||
@@ -362,12 +367,12 @@ public class WeddingPackets extends PacketCreator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles all of WeddingWishlist packets
|
||||
*
|
||||
* @param mode
|
||||
* @param itemnames
|
||||
* @param items
|
||||
* @return mplew
|
||||
* Handles all of WeddingWishlist packets
|
||||
*
|
||||
* @param mode
|
||||
* @param itemnames
|
||||
* @param items
|
||||
* @return mplew
|
||||
*/
|
||||
public static Packet onWeddingGiftResult(byte mode, List<String> itemnames, List<Item> items) {
|
||||
OutPacket p = OutPacket.create(SendOpcode.WEDDING_GIFT_RESULT);
|
||||
@@ -376,7 +381,7 @@ public class WeddingPackets extends PacketCreator {
|
||||
case 0xC: // 12 : You cannot give more than one present for each wishlist
|
||||
case 0xE: // 14 : Failed to send the gift.
|
||||
break;
|
||||
|
||||
|
||||
case 0x09: { // Load Wedding Registry
|
||||
p.writeByte(itemnames.size());
|
||||
for (String names : itemnames) {
|
||||
|
||||
Reference in New Issue
Block a user