Converted GetAuctionDetails from Java to Kotlin

This commit is contained in:
Ziggy
2023-04-11 19:10:12 +02:00
parent adc90e078a
commit f6a5c1b211
2 changed files with 22 additions and 39 deletions

View File

@@ -313,7 +313,7 @@ public enum PacketType {
// Auction
IS_VENDOR_OWNER_RESPONSE_MESSAGE (IsVendorOwnerResponseMessage.CRC, IsVendorOwnerResponseMessage.class),
AUCTION_QUERY_HEADERS_MESSAGE (AuctionQueryHeadersMessage.Companion.getCrc(), AuctionQueryHeadersMessage.class),
GET_AUCTION_DETAILS (GetAuctionDetails.CRC, GetAuctionDetails.class),
GET_AUCTION_DETAILS (GetAuctionDetails.Companion.getCrc(), GetAuctionDetails.class),
GET_AUCTION_DETAILS_RESPONSE (GetAuctionDetailsResponse.CRC, GetAuctionDetailsResponse.class),
CANCEL_LIVE_AUCTION_MESSAGE (CancelLiveAuctionMessage.Companion.getCrc(), CancelLiveAuctionMessage.class),
CANCEL_LIVE_AUCTION_RESPONSE_MESSAGE (CancelLiveAuctionResponseMessage.Companion.getCrc(), CancelLiveAuctionResponseMessage.class),

View File

@@ -24,48 +24,31 @@
* You should have received a copy of the GNU Affero General Public License *
* along with PSWGCommon. If not, see <http://www.gnu.org/licenses/>. *
***********************************************************************************/
package com.projectswg.common.network.packets.swg.zone.auction;
package com.projectswg.common.network.packets.swg.zone.auction
import com.projectswg.common.network.NetBuffer;
import com.projectswg.common.network.packets.SWGPacket;
import com.projectswg.common.network.NetBuffer
import com.projectswg.common.network.packets.SWGPacket
public class GetAuctionDetails extends SWGPacket {
public static final int CRC = com.projectswg.common.data.CRC.getCrc("GetAuctionDetails");
private long objectId;
public GetAuctionDetails() {
this(0);
}
public GetAuctionDetails(long objectId) {
this.objectId = objectId;
}
public GetAuctionDetails(NetBuffer data) {
decode(data);
}
public void decode(NetBuffer data) {
if (!super.checkDecode(data, CRC))
return;
objectId = data.getLong();
}
public NetBuffer encode() {
NetBuffer data = NetBuffer.allocate(14);
data.addShort(2);
data.addInt(CRC);
data.addLong(objectId);
return data;
data class GetAuctionDetails(
var objectId: Long = 0L,
) : SWGPacket() {
companion object {
val crc = getCrc("GetAuctionDetails")
}
public long getObjectId() {
return objectId;
override fun decode(data: NetBuffer) {
if (!super.checkDecode(data, crc)) return
objectId = data.long
}
public void setObjectId(long objectId) {
this.objectId = objectId;
override fun encode(): NetBuffer {
val data = NetBuffer.allocate(14)
data.addShort(2)
data.addInt(crc)
data.addLong(objectId)
return data
}
}
}