public JObject Insert([FromBody] JObject obj) { LogEventEntry.EventType type = (LogEventEntry.EventType)(int) obj["type"]; long accountId = (long)obj["accountId"]; Dictionary <string, object> args = new Dictionary <string, object>(); JObject argsObj = (JObject)obj["args"]; if (argsObj != null) { switch (type) { case LogEventEntry.EventType.OUT_OF_SYNC: args.Add("subTick", (int)argsObj["subTick"]); args.Add("clientChecksum", (int)argsObj["clientChecksum"]); args.Add("serverChecksum", (int)argsObj["serverChecksum"]); args.Add("debugJSON", (string)argsObj["debugJSON"]); break; default: return(this.BuildResponse(HttpStatusCode.InternalServerError)); } LogManager.AddEventLog(type, new LogicLong((int)(accountId >> 32), (int)accountId), args); return(this.BuildResponse(HttpStatusCode.OK)); } return(this.BuildResponse(HttpStatusCode.InternalServerError)); }
public static void AddEventLog(LogEventEntry.EventType type, LogicLong accountId, Dictionary <string, object> args) { LogManager.m_eventLogs.Add(new LogEventEntry(type, accountId, args)); }