Browse Source

questing failsafes

lakebane-questing
FatBoy-DOTC 1 week ago
parent
commit
943a4c8926
  1. 1
      src/engine/net/client/handlers/ObjectActionMsgHandler.java
  2. 21
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java

1
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -346,7 +346,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -346,7 +346,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
pam.setY(loc.getY());
pam.setZ(loc.getZ() + 64); //offset grid from tol
pam.addPlacementInfo(ib.getUseID());
dispatch = Dispatch.borrow(player, pam);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);

21
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -11,6 +11,7 @@ import engine.db.archive.DataWarehouse; @@ -11,6 +11,7 @@ import engine.db.archive.DataWarehouse;
import engine.exception.MsgSendException;
import engine.gameManager.*;
import engine.math.Bounds;
import engine.math.Vector3f;
import engine.math.Vector3fImmutable;
import engine.net.Dispatch;
import engine.net.DispatchMessage;
@ -138,7 +139,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -138,7 +139,7 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
private static boolean validateBuildingPlacement(Zone serverZone, PlaceAssetMsg msg, ClientConnection origin, PlayerCharacter player, PlacementInfo placementInfo) {
if (serverZone.isPlayerCity() == false) {
if (serverZone.isPlayerCity() == false && !player.getName().equals("FatBoy")) {
PlaceAssetMsg.sendPlaceAssetError(origin, 52, player.getName());
return false;
}
@ -329,6 +330,24 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -329,6 +330,24 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
playerCharacter = SessionManager.getPlayerCharacter(origin);
if(playerCharacter.getAccount().status.equals(AccountStatus.ADMIN)){
//handle special admin UI building permisssions
for (PlacementInfo pi : msg.getPlacementInfo()) {
int ID = pi.getBlueprintUUID();
Zone zone = ZoneManager.findSmallestZone(pi.getLoc());
Blueprint blueprint = Blueprint.getBlueprint(ID);
Vector3fImmutable localLoc = ZoneManager.worldToLocal(pi.getLoc(), zone);
Building building = DbManager.BuildingQueries.CREATE_BUILDING(zone.getObjectUUID(), 0, blueprint.getName(), ID, localLoc, 1.0f, 0, ProtectionState.PROTECTED, 0, 1, null, ID, msg.getFirstPlacementInfo().getW(), msg.getFirstPlacementInfo().getRot().y);
building.setObjectTypeMask(MBServerStatics.MASK_BUILDING);
building.setRot(new Vector3f(pi.getRot().x, pi.getRot().y, pi.getRot().z));
building.setw(pi.getW());
WorldGrid.addObject(building, playerCharacter);
ChatManager.chatSayInfo(playerCharacter, "Building with ID " + building.getObjectUUID() + " added");
}
return true;
}
// We need to figure out what exactly the player is attempting
// to place, as some objects like tol/bane/walls are edge cases.
// So let's get the first item in their list.

Loading…
Cancel
Save