Merge pull request #7 from madsboddum/missionacceptrequest

Added MissionAcceptRequest object controller
This commit is contained in:
Josh Larson
2020-07-10 21:26:54 -04:00
committed by GitHub
2 changed files with 78 additions and 0 deletions
@@ -0,0 +1,77 @@
/***********************************************************************************
* Copyright (c) 2018 /// 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 <http://www.gnu.org/licenses/>. *
***********************************************************************************/
package com.projectswg.common.network.packets.swg.zone.object_controller;
import com.projectswg.common.network.NetBuffer;
public class MissionAcceptRequest extends ObjectController{
public static final int CRC = 0x00F9;
private long missionId;
private long terminalId;
public MissionAcceptRequest(NetBuffer data) {
super(CRC);
decode(data);
}
public long getTerminalId() {
return terminalId;
}
public void setTerminalId(long terminalId) {
this.terminalId = terminalId;
}
public long getMissionId() {
return missionId;
}
public void setMissionId(long missionId) {
this.missionId = missionId;
}
@Override
public void decode(NetBuffer data) {
decodeHeader(data);
setMissionId(data.getLong());
setTerminalId(data.getLong());
data.getByte();
}
@Override
public NetBuffer encode() {
NetBuffer data = NetBuffer.allocate(HEADER_LENGTH + 17);
encodeHeader(data);
data.addLong(getMissionId());
data.addLong(getTerminalId());
data.addByte(0);
return data;
}
}
@@ -130,6 +130,7 @@ public abstract class ObjectController extends SWGPacket {
case 0x04BC: return new ShowLootBox(data);
case 0x04C5: return new IntendedTarget(data);
case 0x00F5: return new MissionListRequest(data);
case 0x00F9: return new MissionAcceptRequest(data);
case 0x041C: return new JTLTerminalSharedMessage(data);
case 0x0115: return new SecureTrade(data);
}