public static void CreateStatistics() { string[] stats = { "steps taken" }; //{"Obtained BP", "Ride used", "Eggs hatched", "Evolutions", "Moves learned", "Caught Pokemon", "Blackouts", "[53]Status booster used", "[25]Vitamins used", "TMs/HMs used", "[17]Medicine Items used", "[22]Evolution stones used", "[42]Repels used", "Cut used", "Surf used", "Fly used", "Strength used", "Waterfall used", "Flash used", "Rock smash used", "Whirlpool used", "Items found", "GTS Trades", "Wondertrades", "Battle Spot battles", "Trades", "PVP battles", "[2006]Berries picked", "[85]Apricorns picked", "Moves learned", "[4]Poké Balls used", "Wild battles", "Trainer battles", "Safari battles", "Bug-Catching contest battles"} for (var i = 0; i <= stats.Length - 1; i++) { APICall APICall = new APICall(); APICall.SetStorageData(GetKey(stats[i]), "0", false); } }
public static void Start() { if (API.LoggedIn && Status != "WaitingForCheck") { Logger.Debug("Starting session..."); Status = "WaitingForCheck"; var apiCall = new APICall(CheckedSession); apiCall.CheckSession(); } }
public static void Close() { if (API.LoggedIn) { Logger.Debug("Closing session..."); var apiCall = new APICall(); apiCall.CloseSession(); LastPing = DateTime.Now; SessionStarted = false; } }
public static void Track(string statName, int addition) { if (CanTrack(statName) == true) { APICall APICall = new APICall(); if (statName.ToLower() == "steps taken") { addition = TempSteps; TempSteps = 0; } APICall.UpdateStorageData(GetKey(statName), addition.ToString(NumberFormatInfo.InvariantInfo), "add", false); Logger.Debug("Track online statistic: " + statName + " (" + addition.ToString(NumberFormatInfo.InvariantInfo) + ")"); } }
public static void CheckedSession(string result) { var list = API.HandleData(result); var apiCall = new APICall(); apiCall.OpenSession(); Status = "WaitingForOpen"; LastPing = DateTime.Now; if (list[0].Value == "true") { Logger.Log(Logger.LogTypes.Warning, "SessionManager.vb: Tried to log in with an already logged in account!"); } }
public static void Ping() { int diff = Convert.ToInt32((DateTime.Now - LastPing).Seconds); if (diff >= 30) { Logger.Debug("Ping session..."); LastPing = DateTime.Now; if (API.LoggedIn) { var apiCall = new APICall(); apiCall.CallFails += Kick; apiCall.PingSession(); } } }
public static void GetStatisticValue(string statName, Action <string> resultFunction) { var apiCall = new APICall(resultFunction); apiCall.GetStorageData(GetKey(statName), false); }