private void processDialogResponse(DialogResponse resp) { log("Hit", "processDialogResponse"); Utility.showDialog(resp.Title, resp.Body, "Close"); }
public static BaseResponse messageFromBytes(byte[] buffer) { VRage.ByteStream stream = new VRage.ByteStream(buffer, buffer.Length); TYPE t = (TYPE)stream.getUShort(); stream.Seek(0, SeekOrigin.Begin); BaseResponse msg = null; switch (t) { case TYPE.NOTIFICATION: msg = new NotificationResponse(); break; case TYPE.DIALOG: msg = new DialogResponse(); break; case TYPE.SETTINGS: msg = new SettingsResponse(); break; case TYPE.FLEET: msg = new FleetResponse(); break; } if (msg != null) msg.deserialize(stream); return msg; }
private void processViolationsRequest(ViolationsRequest req) { // Get an Owner object from the player ID of the request GridOwner.OWNER owner = GridOwner.ownerFromPlayerID(req.ReturnAddress); // Retrieve that owner's fleet FactionFleet fleet = GardenConquest.Core.StateTracker. getInstance().getFleet(owner.FleetID, owner.OwnerType); // Get the fleet's juicy description String body = fleet.violationsToString(); // build the title String title = ""; switch (owner.OwnerType) { case GridOwner.OWNER_TYPE.FACTION: title = "Your Faction's Fleet's Violations"; break; case GridOwner.OWNER_TYPE.PLAYER: title = "Your Fleet Violations"; break; } // send the response DialogResponse resp = new DialogResponse() { Body = body, Title = title, Destination = new List<long>() { req.ReturnAddress }, DestType = BaseResponse.DEST_TYPE.PLAYER }; send(resp); }