feat: add party id and remove fc
This commit is contained in:
parent
6e048b0987
commit
5c78143786
|
@ -28,6 +28,9 @@ public sealed class Plugin : IDalamudPlugin {
|
|||
[PluginService]
|
||||
internal IClientState ClientState { get; init; }
|
||||
|
||||
[PluginService]
|
||||
internal IPartyList PartyList { get; init; }
|
||||
|
||||
internal Configuration Config { get; }
|
||||
internal PluginUi Ui { get; }
|
||||
|
||||
|
@ -63,6 +66,10 @@ public sealed class Plugin : IDalamudPlugin {
|
|||
|
||||
this.Stopwatch.Restart();
|
||||
|
||||
var partyId = (ulong) this.PartyList.PartyId;
|
||||
var party = this.PartyList
|
||||
.Select(member => member.ObjectId)
|
||||
.ToList();
|
||||
var territory = this.ClientState.TerritoryType;
|
||||
var players = this.ObjectTable
|
||||
.Where(obj => obj.ObjectKind == ObjectKind.Player && obj is PlayerCharacter)
|
||||
|
@ -88,9 +95,9 @@ public sealed class Plugin : IDalamudPlugin {
|
|||
player.Customize,
|
||||
player.Level,
|
||||
player.ClassJob.Id,
|
||||
player.CompanyTag.TextValue,
|
||||
player.CurrentHp,
|
||||
player.MaxHp
|
||||
player.MaxHp,
|
||||
partyId != 0 && party.Contains(player.ObjectId) ? partyId : null
|
||||
);
|
||||
})
|
||||
.ToList();
|
||||
|
@ -206,14 +213,14 @@ public struct PlayerInfo {
|
|||
public readonly uint Job;
|
||||
|
||||
[Key(9)]
|
||||
public readonly string FreeCompany;
|
||||
|
||||
[Key(10)]
|
||||
public readonly uint CurrentHp;
|
||||
|
||||
[Key(11)]
|
||||
[Key(10)]
|
||||
public readonly uint MaxHp;
|
||||
|
||||
[Key(11)]
|
||||
public readonly ulong? PartyId;
|
||||
|
||||
public PlayerInfo(
|
||||
byte[] hash,
|
||||
uint world,
|
||||
|
@ -224,9 +231,9 @@ public struct PlayerInfo {
|
|||
byte[] customize,
|
||||
byte level,
|
||||
uint job,
|
||||
string freeCompany,
|
||||
uint currentHp,
|
||||
uint maxHp
|
||||
uint maxHp,
|
||||
ulong? partyId
|
||||
) {
|
||||
this.Hash = hash;
|
||||
this.World = world;
|
||||
|
@ -237,8 +244,8 @@ public struct PlayerInfo {
|
|||
this.Customize = customize;
|
||||
this.Level = level;
|
||||
this.Job = job;
|
||||
this.FreeCompany = freeCompany;
|
||||
this.CurrentHp = currentHp;
|
||||
this.MaxHp = maxHp;
|
||||
this.PartyId = partyId;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue