public override void DoAction(IEventArgs args) { DataRecord dr = new DataRecord(); dr.AddField("time", DateTime.Now.Ticks.ToString()); dr.AddField("key", key); dr.AddField("message", FreeUtil.ReplaceVar(message, args)); MysqlUtil.Add(dr, "simple_log", FreeRuleConfig.MysqlConnection); }
protected static void RecordMultiResult(CaseKey key, TestValue[] tvs, string table) { DataRecord dr = new DataRecord(); dr.AddField("rule", key.rule); dr.AddField("suit", key.suit); dr.AddField("case", key.caseName); dr.AddField("field", tvs[0].Name); dr.AddField("value", TestValue.ToRecords(tvs)); Debug.LogFormat("table:{0}, dr:{1}", table, dr); MysqlUtil.Add(dr, table, FreeRuleConfig.MysqlConnection); }
public static void Add(Vector3 position, float rotation, string timeStamp) { DataRecord dataRecord = new DataRecord(); dataRecord.AddField(FIELD_MAP_ID, MapId.ToString()); dataRecord.AddField(FIELD_POSITION_TYPE, Type); dataRecord.AddField(FIELD_X, position.x.ToString()); dataRecord.AddField(FIELD_Y, position.y.ToString()); dataRecord.AddField(FIELD_Z, position.z.ToString()); dataRecord.AddField(FIELD_ROTATION, rotation.ToString()); dataRecord.AddField(FIELD_TIME, timeStamp); MysqlUtil.Add(dataRecord, TABLE, MysqlConnection); if (!Exsit(timeStamp)) { TestPosition testPosition = new TestPosition(); testPosition.mapId = MapId.ToString(); testPosition.type = Type; testPosition.x = position.x; testPosition.y = position.y; testPosition.z = position.z; testPosition.rotation = rotation; testPosition.time = timeStamp; gTestPositions.Add(testPosition); } }