diff --git a/src/main/java/com/projectswg/common/network/packets/PacketType.java b/src/main/java/com/projectswg/common/network/packets/PacketType.java index 0db2bae..149d7eb 100644 --- a/src/main/java/com/projectswg/common/network/packets/PacketType.java +++ b/src/main/java/com/projectswg/common/network/packets/PacketType.java @@ -1,5 +1,5 @@ /*********************************************************************************** - * Copyright (c) 2018 /// Project SWG /// www.projectswg.com * + * Copyright (c) 2023 /// Project SWG /// www.projectswg.com * * * * ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on * * July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. * @@ -30,6 +30,7 @@ import com.projectswg.common.data.EnumLookup; import com.projectswg.common.network.packets.swg.holo.login.HoloLoginRequestPacket; import com.projectswg.common.network.packets.swg.holo.login.HoloLoginResponsePacket; import com.projectswg.common.network.packets.swg.zone.*; +import com.projectswg.common.network.packets.swg.zone.auction.*; import com.projectswg.common.network.packets.swg.zone.space.ShipUpdateTransformMessage; import com.projectswg.common.network.packets.swg.zone.structures.EnterStructurePlacementModeMessage; import me.joshlarson.jlcommon.log.Log; @@ -93,18 +94,6 @@ import com.projectswg.common.network.packets.swg.zone.UpdatePostureMessage; import com.projectswg.common.network.packets.swg.zone.UpdatePvpStatusMessage; import com.projectswg.common.network.packets.swg.zone.UpdateTransformMessage; import com.projectswg.common.network.packets.swg.zone.UpdateTransformWithParentMessage; -import com.projectswg.common.network.packets.swg.zone.auction.AuctionQueryHeadersMessage; -import com.projectswg.common.network.packets.swg.zone.auction.AuctionQueryHeadersResponseMessage; -import com.projectswg.common.network.packets.swg.zone.auction.CancelLiveAuctionMessage; -import com.projectswg.common.network.packets.swg.zone.auction.CancelLiveAuctionResponseMessage; -import com.projectswg.common.network.packets.swg.zone.auction.CommoditiesItemTypeListRequest; -import com.projectswg.common.network.packets.swg.zone.auction.CommoditiesItemTypeListResponse; -import com.projectswg.common.network.packets.swg.zone.auction.GetAuctionDetails; -import com.projectswg.common.network.packets.swg.zone.auction.GetAuctionDetailsResponse; -import com.projectswg.common.network.packets.swg.zone.auction.IsVendorOwnerMessage; -import com.projectswg.common.network.packets.swg.zone.auction.IsVendorOwnerResponseMessage; -import com.projectswg.common.network.packets.swg.zone.auction.RetrieveAuctionItemMessage; -import com.projectswg.common.network.packets.swg.zone.auction.RetrieveAuctionItemResponseMessage; import com.projectswg.common.network.packets.swg.zone.baselines.Baseline; import com.projectswg.common.network.packets.swg.zone.building.UpdateCellPermissionMessage; import com.projectswg.common.network.packets.swg.zone.chat.ChatAddModeratorToRoom; @@ -334,6 +323,7 @@ public enum PacketType { IS_VENDOR_OWNER_MESSAGE (IsVendorOwnerMessage.CRC, IsVendorOwnerMessage.class), COMMODITIES_ITEM_TYPE_LIST_REPSONSE (CommoditiesItemTypeListResponse.CRC, CommoditiesItemTypeListResponse.class), COMMODITIES_ITEM_TYPE_LIST_REQUEST (CommoditiesItemTypeListRequest.CRC, CommoditiesItemTypeListRequest.class), + CREATE_IMMEDIATE_AUCTION_MESSAGE (CreateImmediateAuctionMessage.Companion.getCrc(), CreateImmediateAuctionMessage.class), // Travel ENTER_TICKET_PURCHASE_MODE_MESSAGE (EnterTicketPurchaseModeMessage.CRC, EnterTicketPurchaseModeMessage.class), diff --git a/src/main/java/com/projectswg/common/network/packets/swg/zone/auction/CreateImmediateAuctionMessage.kt b/src/main/java/com/projectswg/common/network/packets/swg/zone/auction/CreateImmediateAuctionMessage.kt new file mode 100644 index 0000000..2aff9ad --- /dev/null +++ b/src/main/java/com/projectswg/common/network/packets/swg/zone/auction/CreateImmediateAuctionMessage.kt @@ -0,0 +1,67 @@ +/*********************************************************************************** + * Copyright (c) 2023 /// Project SWG /// www.projectswg.com * + * * + * ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on * + * July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. * + * Our goal is to create an emulator which will provide a server for players to * + * continue playing a game similar to the one they used to play. We are basing * + * it on the final publish of the game prior to end-game events. * + * * + * This file is part of PSWGCommon. * + * * + * --------------------------------------------------------------------------------* + * * + * PSWGCommon is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * PSWGCommon is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with PSWGCommon. If not, see . * + ***********************************************************************************/ +package com.projectswg.common.network.packets.swg.zone.auction + +import com.projectswg.common.network.NetBuffer +import com.projectswg.common.network.packets.SWGPacket + +data class CreateImmediateAuctionMessage( + var objectId: Long = 0L, + var vendorId: Long = 0L, + var price: Int = 0, + var duration: Int = 0, + var description: String = "", + var premium: Boolean = false, +) : SWGPacket() { + + companion object { + val crc = getCrc("CreateImmediateAuctionMessage") + } + + override fun decode(data: NetBuffer) { + if (!super.checkDecode(data, crc)) return + objectId = data.long + vendorId = data.long + price = data.int + duration = data.int + description = data.unicode + premium = data.boolean + } + + override fun encode(): NetBuffer { + val data = NetBuffer.allocate(29 + (description.length * 2)) + + data.addLong(objectId) + data.addLong(vendorId) + data.addInt(price) + data.addInt(duration) + data.addUnicode(description) + data.addBoolean(premium) + + return data + } +} \ No newline at end of file