feat: separate invite to party

This commit is contained in:
Anna
2022-02-01 18:33:08 -05:00
parent 2af0466d94
commit fb3ee2efe2
6 changed files with 38 additions and 21 deletions
+15 -8
View File
@@ -1,8 +1,8 @@
using ChatTwo.Util;
using Dalamud.Utility.Signatures;
using FFXIVClientStructs.FFXIV.Client.System.Framework;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI;
using Siggingway;
namespace ChatTwo.GameFunctions;
@@ -23,17 +23,29 @@ internal sealed unsafe class Party {
internal Party(Plugin plugin) {
this.Plugin = plugin;
Siggingway.Siggingway.Initialise(this.Plugin.SigScanner, this);
SignatureHelper.Initialise(this);
}
internal void Invite(string name, ushort world, ulong contentId) {
internal void InviteSameWorld(string name, ushort world, ulong contentId) {
if (this._inviteToParty == null) {
return;
}
// 6.05: 20D722
var a1 = this.Plugin.Functions.GetInfoProxyByIndex(1);
fixed (byte* namePtr = name.ToTerminatedBytes()) {
// this only works if target is on the same world
this._inviteToParty(a1, contentId, namePtr, world);
}
}
internal void InviteOtherWorld(ulong contentId) {
if (this._inviteToPartyContentId != null) {
return;
}
// 6.05: 20D722
var a1 = this.Plugin.Functions.GetInfoProxyByIndex(1);
if (contentId != 0) {
// third param is world, but it requires a specific world
// if they're not on that world, it will fail
@@ -41,11 +53,6 @@ internal sealed unsafe class Party {
// current player is on
this._inviteToPartyContentId(a1, contentId, 0);
}
fixed (byte* namePtr = name.ToTerminatedBytes()) {
// this only works if target is on the same world
this._inviteToParty(a1, contentId, namePtr, world);
}
}
internal void Kick(string name, ulong contentId) {