static public JToken setCommunityGoal(JournalCommunityGoal.CommunityGoal goals, DateTime dt) { JObject eventData = new JObject(); eventData["communitygoalGameID"] = goals.CGID; eventData["communitygoalName"] = goals.Title; eventData["starsystemName"] = goals.SystemName; eventData["stationName"] = goals.MarketName; eventData["goalExpiry"] = goals.Expiry.ToStringZulu(); if (goals.TierReachedInt.HasValue) { eventData["tierReached"] = goals.TierReachedInt.Value; } if (goals.TopTierInt.HasValue) { eventData["tierMax"] = goals.TopTierInt; } if (goals.TopRankSize.HasValue) { eventData["topRankSize"] = goals.TopRankSize.Value; } eventData["isCompleted"] = goals.IsComplete; eventData["contributorsNum"] = goals.NumContributors; eventData["contributionsTotal"] = goals.CurrentTotal; if (goals.TopTierBonus.HasChars()) { eventData["completionBonus"] = goals.TopTierBonus; } return(Event("setCommunityGoal", dt, eventData)); }
static public JToken setCommandersCommunityGoalProgress(JournalCommunityGoal.CommunityGoal goals, DateTime dt) { if (goals.Bonus.HasValue) { JObject eventData = new JObject(); eventData["communitygoalGameID"] = goals.CGID; eventData["contribution"] = goals.NumContributors; eventData["percentileBand"] = goals.PlayerPercentileBand; eventData["percentileBandReward"] = goals.Bonus.Value; return(Event("setCommanderCommunityGoalProgress", dt, eventData)); } else { return(null); } }