fix: account for world
This commit is contained in:
parent
581b4806ed
commit
290d79034c
|
@ -32,6 +32,7 @@ internal class MessageWithTerritory {
|
||||||
public uint Territory { get; init; }
|
public uint Territory { get; init; }
|
||||||
public uint? Ward { get; init; }
|
public uint? Ward { get; init; }
|
||||||
public uint? Plot { get; init; }
|
public uint? Plot { get; init; }
|
||||||
|
public uint? World { get; init; }
|
||||||
public float X { get; init; }
|
public float X { get; init; }
|
||||||
public float Y { get; init; }
|
public float Y { get; init; }
|
||||||
public float Z { get; init; }
|
public float Z { get; init; }
|
||||||
|
|
|
@ -181,6 +181,11 @@ internal class Messages : IDisposable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var world = this.Plugin.ClientState.LocalPlayer?.CurrentWorld.Id ?? 0;
|
||||||
|
if (world == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var housing = this.Plugin.Common.Functions.Housing.Location;
|
var housing = this.Plugin.Common.Functions.Housing.Location;
|
||||||
var ward = housing?.Ward;
|
var ward = housing?.Ward;
|
||||||
var plot = housing?.CombinedPlot();
|
var plot = housing?.CombinedPlot();
|
||||||
|
@ -205,14 +210,14 @@ internal class Messages : IDisposable {
|
||||||
|
|
||||||
Task.Run(async () => {
|
Task.Run(async () => {
|
||||||
try {
|
try {
|
||||||
await this.DownloadMessages(territory, ward, plot);
|
await this.DownloadMessages(world, territory, ward, plot);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
PluginLog.LogError(ex, $"Failed to get messages for territory {territory}");
|
PluginLog.LogError(ex, $"Failed to get messages for territory {territory}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task DownloadMessages(ushort territory, ushort? ward, ushort? plot) {
|
private async Task DownloadMessages(uint world, ushort territory, ushort? ward, ushort? plot) {
|
||||||
var route = $"/messages/{territory}";
|
var route = $"/messages/{territory}";
|
||||||
if (ward != null) {
|
if (ward != null) {
|
||||||
route += $"?ward={ward}";
|
route += $"?ward={ward}";
|
||||||
|
@ -220,6 +225,8 @@ internal class Messages : IDisposable {
|
||||||
if (plot != null) {
|
if (plot != null) {
|
||||||
route += $"&plot={plot}";
|
route += $"&plot={plot}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
route += $"&world={world}";
|
||||||
}
|
}
|
||||||
|
|
||||||
var resp = await ServerHelper.SendRequest(
|
var resp = await ServerHelper.SendRequest(
|
||||||
|
|
|
@ -76,7 +76,20 @@ internal class MessageList : ITab {
|
||||||
|
|
||||||
var loc = $"Location: {territoryName}";
|
var loc = $"Location: {territoryName}";
|
||||||
if (message.Ward != null) {
|
if (message.Ward != null) {
|
||||||
loc += $" (Ward {message.Ward.Value}";
|
loc += " (";
|
||||||
|
|
||||||
|
if (message.World != null) {
|
||||||
|
var world = this.Plugin.DataManager.GetExcelSheet<World>()?.GetRow((ushort) message.World);
|
||||||
|
if (world != null) {
|
||||||
|
loc += world.Name.ToDalamudString().TextValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loc != " (") {
|
||||||
|
loc += ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
loc += $"Ward {message.Ward.Value}";
|
||||||
|
|
||||||
if (message.Plot != null) {
|
if (message.Plot != null) {
|
||||||
if (message.Plot.Value >= HousingLocationExt.Apt) {
|
if (message.Plot.Value >= HousingLocationExt.Apt) {
|
||||||
|
|
Loading…
Reference in New Issue