refactor: update for api 9
This commit is contained in:
parent
3ab9670da1
commit
89cfed4300
|
@ -6,13 +6,13 @@ using System.Linq;
|
|||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.Gui.PartyFinder.Types;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace RemotePartyFinder {
|
||||
internal class Gatherer : IDisposable {
|
||||
namespace RemotePartyFinder;
|
||||
|
||||
internal class Gatherer : IDisposable {
|
||||
#if DEBUG
|
||||
private const string UploadUrl = "http://192.168.174.240:7878/contribute/multiple";
|
||||
#elif RELEASE
|
||||
|
@ -47,7 +47,7 @@ namespace RemotePartyFinder {
|
|||
this.Batches[args.BatchNumber].Add(listing);
|
||||
}
|
||||
|
||||
private void OnUpdate(Framework framework) {
|
||||
private void OnUpdate(IFramework framework1) {
|
||||
if (this.UploadTimer.Elapsed < TimeSpan.FromSeconds(10)) {
|
||||
return;
|
||||
}
|
||||
|
@ -65,9 +65,8 @@ namespace RemotePartyFinder {
|
|||
Headers = { ContentType = MediaTypeHeaderValue.Parse("application/json") },
|
||||
});
|
||||
var output = await resp.Content.ReadAsStringAsync();
|
||||
PluginLog.Log(output);
|
||||
Plugin.Log.Info(output);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
using Dalamud.Game;
|
||||
using Dalamud.Game.Gui.PartyFinder;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.IoC;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
|
||||
namespace RemotePartyFinder {
|
||||
public class Plugin : IDalamudPlugin {
|
||||
public string Name => "Remote Party Finder";
|
||||
namespace RemotePartyFinder;
|
||||
|
||||
public class Plugin : IDalamudPlugin {
|
||||
[PluginService]
|
||||
internal static IPluginLog Log { get; private set; }
|
||||
|
||||
[PluginService]
|
||||
internal Framework Framework { get; private init; }
|
||||
internal IFramework Framework { get; private init; }
|
||||
|
||||
[PluginService]
|
||||
internal PartyFinderGui PartyFinderGui { get; private init; }
|
||||
internal IPartyFinderGui PartyFinderGui { get; private init; }
|
||||
|
||||
private Gatherer Gatherer { get; }
|
||||
|
||||
|
@ -22,5 +23,4 @@ namespace RemotePartyFinder {
|
|||
public void Dispose() {
|
||||
this.Gatherer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,11 @@ using Dalamud.Game.Gui.PartyFinder.Types;
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace RemotePartyFinder {
|
||||
[Serializable]
|
||||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
|
||||
internal class UploadableListing {
|
||||
namespace RemotePartyFinder;
|
||||
|
||||
[Serializable]
|
||||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
|
||||
internal class UploadableListing {
|
||||
public uint Id { get; }
|
||||
public uint ContentIdLower { get; }
|
||||
public byte[] Name { get; }
|
||||
|
@ -58,15 +59,14 @@ namespace RemotePartyFinder {
|
|||
this.Slots = listing.Slots.Select(slot => new UploadableSlot(slot)).ToList();
|
||||
this.JobsPresent = listing.RawJobsPresent.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
|
||||
internal class UploadableSlot {
|
||||
[Serializable]
|
||||
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
|
||||
internal class UploadableSlot {
|
||||
public JobFlags Accepting { get; }
|
||||
|
||||
internal UploadableSlot(PartyFinderSlot slot) {
|
||||
this.Accepting = slot.Accepting.Aggregate((JobFlags) 0, (agg, flag) => agg | flag);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,8 +3,9 @@ using Pidgin;
|
|||
using static Pidgin.Parser;
|
||||
using static Pidgin.Parser<char>;
|
||||
|
||||
namespace SourceGenerator {
|
||||
internal static class AutoTranslate {
|
||||
namespace SourceGenerator;
|
||||
|
||||
internal static class AutoTranslate {
|
||||
internal static Parser<char, (string name, Maybe<IEnumerable<ISelectorPart>> selector)> Parser() {
|
||||
var sheetName = Any
|
||||
.AtLeastOnceUntil(Lookahead(Char('[').IgnoreResult().Or(End)))
|
||||
|
@ -49,20 +50,20 @@ namespace SourceGenerator {
|
|||
selector.Optional()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal interface ISelectorPart {
|
||||
}
|
||||
internal interface ISelectorPart {
|
||||
}
|
||||
|
||||
internal class SingleRow : ISelectorPart {
|
||||
internal class SingleRow : ISelectorPart {
|
||||
public uint Row { get; }
|
||||
|
||||
public SingleRow(uint row) {
|
||||
this.Row = row;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class IndexRange : ISelectorPart {
|
||||
internal class IndexRange : ISelectorPart {
|
||||
public uint Start { get; }
|
||||
public uint End { get; }
|
||||
|
||||
|
@ -70,16 +71,15 @@ namespace SourceGenerator {
|
|||
this.Start = start;
|
||||
this.End = end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class NounMarker : ISelectorPart {
|
||||
}
|
||||
internal class NounMarker : ISelectorPart {
|
||||
}
|
||||
|
||||
internal class ColumnSpecifier : ISelectorPart {
|
||||
internal class ColumnSpecifier : ISelectorPart {
|
||||
public uint Column { get; }
|
||||
|
||||
public ColumnSpecifier(uint column) {
|
||||
this.Column = column;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,8 +10,9 @@ using Lumina.Excel.GeneratedSheets;
|
|||
using Lumina.Text;
|
||||
using Pidgin;
|
||||
|
||||
namespace SourceGenerator {
|
||||
internal class Program {
|
||||
namespace SourceGenerator;
|
||||
|
||||
internal class Program {
|
||||
private static void Main(string[] args) {
|
||||
var data = new Dictionary<Language, GameData>(4);
|
||||
foreach (var lang in Languages.Keys) {
|
||||
|
@ -457,5 +458,4 @@ namespace SourceGenerator {
|
|||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,9 @@
|
|||
using Lumina.Text;
|
||||
using Lumina.Text.Payloads;
|
||||
|
||||
namespace SourceGenerator {
|
||||
internal static class SeStringExtensions {
|
||||
namespace SourceGenerator;
|
||||
|
||||
internal static class SeStringExtensions {
|
||||
internal static string TextValue(this SeString str) {
|
||||
var payloads = str.Payloads
|
||||
.Select(p => {
|
||||
|
@ -33,5 +34,4 @@ namespace SourceGenerator {
|
|||
|
||||
return string.Join("", payloads);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue