using SharedLibraryCore; using SharedLibraryCore.Database.Models; using SharedLibraryCore.Interfaces; using System.Collections.Generic; using EventGeneratorCallback = System.ValueTuple>; namespace IW4MAdmin.Plugins.ClanTagRankCommands.Events { public class Script : IRegisterEvent { private const string EVENT_RC = "RC"; /// /// this is a custom event printed out by _clientids.gsc (used for recording highest personal round records) /// /// private EventGeneratorCallback RC() { return (EVENT_RC, EVENT_RC, (string eventLine, IEventParserConfiguration config, GameEvent autoEvent) => { string[] lineSplit = eventLine.Split(";"); long originId = lineSplit[1].ConvertGuidToLong(config.GuidNumberStyle, 1); autoEvent.Type = GameEvent.EventType.Other; autoEvent.Origin = new EFClient() { NetworkId = originId }; autoEvent.RequiredEntity = GameEvent.EventRequiredEntity.Origin; autoEvent.GameTime = autoEvent.GameTime; autoEvent.Subtype = EVENT_RC; return autoEvent; } ); } //private const string EVENT_RoundNumber = "RoundNumber"; ///// ///// this is a custom event printed out by _clientids.gsc (used for recording highest server round records) ///// ///// //private EventGeneratorCallback RoundNumber() //{ // return (EVENT_RoundNumber, EVENT_RoundNumber, (string eventLine, IEventParserConfiguration config, GameEvent autoEvent) => // { // string[] lineSplit = eventLine.Split(";"); // autoEvent.Type = GameEvent.EventType.RoundNumber; // autoEvent.Origin = Utilities.IW4MAdminClient(); // autoEvent.GameTime = autoEvent.GameTime; // return autoEvent; // } // ); //} public IEnumerable Events => new[] { RC(), }; } }