Finished CancelLiveAuctionMessage and CancelLiveAuctionResponseMessage packets

This commit is contained in:
Ziggy
2023-04-11 16:19:07 +02:00
parent f6350f3069
commit 48be1e000e
3 changed files with 56 additions and 64 deletions

View File

@@ -315,8 +315,8 @@ public enum PacketType {
AUCTION_QUERY_HEADERS_MESSAGE (AuctionQueryHeadersMessage.Companion.getCrc(), AuctionQueryHeadersMessage.class),
GET_AUCTION_DETAILS (GetAuctionDetails.CRC, GetAuctionDetails.class),
GET_AUCTION_DETAILS_RESPONSE (GetAuctionDetailsResponse.CRC, GetAuctionDetailsResponse.class),
CANCEL_LIVE_AUCTION_MESSAGE (CancelLiveAuctionMessage.CRC, CancelLiveAuctionMessage.class),
CANCEL_LIVE_AUCTION_RESPONSE_MESSAGE (CancelLiveAuctionResponseMessage.CRC, CancelLiveAuctionResponseMessage.class),
CANCEL_LIVE_AUCTION_MESSAGE (CancelLiveAuctionMessage.Companion.getCrc(), CancelLiveAuctionMessage.class),
CANCEL_LIVE_AUCTION_RESPONSE_MESSAGE (CancelLiveAuctionResponseMessage.Companion.getCrc(), CancelLiveAuctionResponseMessage.class),
AUCTION_QUERY_HEADERS_RESPONSE_MESSAGE (AuctionQueryHeadersResponseMessage.CRC, AuctionQueryHeadersResponseMessage.class),
RETRIEVE_AUCTION_ITEM_MESSAGE (RetrieveAuctionItemMessage.Companion.getCrc(), RetrieveAuctionItemMessage.class),
RETRIEVE_AUCTION_ITEM_RESPONSE_MESSAGE (RetrieveAuctionItemResponseMessage.Companion.getCrc(), RetrieveAuctionItemResponseMessage.class),

View File

@@ -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. *
@@ -24,37 +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 CancelLiveAuctionMessage extends SWGPacket {
public static final int CRC = com.projectswg.common.data.CRC.getCrc("CancelLiveAuctionMessage");
public CancelLiveAuctionMessage() {
}
public CancelLiveAuctionMessage(String command) {
}
public CancelLiveAuctionMessage(NetBuffer data) {
decode(data);
}
public void decode(NetBuffer data) {
if (!super.checkDecode(data, CRC))
return;
}
public NetBuffer encode() {
NetBuffer data = NetBuffer.allocate(6);
data.addShort(2);
data.addInt(CRC);
return data;
data class CancelLiveAuctionMessage(
var objectId: Long = 0L,
) : SWGPacket() {
companion object {
val crc = getCrc("CancelLiveAuctionMessage")
}
}
override fun decode(data: NetBuffer) {
if (!super.checkDecode(data, crc)) return
objectId = data.long
}
override fun encode(): NetBuffer {
val data = NetBuffer.allocate(14)
data.addShort(2)
data.addInt(crc)
data.addLong(objectId)
return data
}
}

View File

@@ -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. *
@@ -24,37 +24,35 @@
* 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 CancelLiveAuctionResponseMessage extends SWGPacket {
public static final int CRC = com.projectswg.common.data.CRC.getCrc("CancelLiveAuctionResponseMessage");
public CancelLiveAuctionResponseMessage() {
}
public CancelLiveAuctionResponseMessage(String command) {
}
public CancelLiveAuctionResponseMessage(NetBuffer data) {
decode(data);
}
public void decode(NetBuffer data) {
if (!super.checkDecode(data, CRC))
return;
}
public NetBuffer encode() {
NetBuffer data = NetBuffer.allocate(6);
data.addShort(2);
data.addInt(CRC);
return data;
data class CancelLiveAuctionResponseMessage(
var objectId: Long = 0L,
var errorCode: Int = 0,
var vendorRefusal: Boolean = false,
) : SWGPacket() {
companion object {
val crc = getCrc("CancelLiveAuctionResponseMessage")
}
}
override fun decode(data: NetBuffer) {
if (!super.checkDecode(data, crc)) return
objectId = data.long
}
override fun encode(): NetBuffer {
val data = NetBuffer.allocate(19)
data.addShort(4)
data.addInt(crc)
data.addLong(objectId)
data.addInt(errorCode)
data.addBoolean(vendorRefusal)
return data
}
}