/// <summary> /// 新建人物 /// </summary> /// <param name="QQID"></param> /// <param name="newGold"></param> /// <param name="newLucky"></param> /// <returns></returns> public static bool AddGoldToDB(string QQID, int newGold, int newLucky) { DataBase.MySqlUtil mySqlUtil = new DataBase.MySqlUtil(); mySqlUtil.SetDBInfo(dbIP, dbName, dbUser, dbPwd, dbPort, dbFile); string SqlString = "insert into characters values(\"" + QQID + "\",\"" + newGold + "\",\"" + newLucky + "\")"; mySqlUtil.SetCammandText(SqlString); try { mySqlUtil.ExecuteNonQuery(); IRQQUtil.WritePluginLogFile(logfile, "增加数据库成功" + DateTime.Now); return(true); } catch (Exception ex) { IRQQUtil.WritePluginLogFile(logfile, "增加数据库失败" + ex + DateTime.Now); return(false); } }
/// <summary> /// 更新技能数值 /// </summary> /// <param name="QQID"></param> /// <param name="skillChance"></param> /// <param name="effLower"></param> /// <param name="effUpper"></param> /// <returns></returns> public static bool UpdateSkillThiefToDB(string QQID, int skillChance, int effLower, int effUpper) { DataBase.MySqlUtil mySqlUtil = new DataBase.MySqlUtil(); mySqlUtil.SetDBInfo(dbIP, dbName, dbUser, dbPwd, dbPort, dbFile); string SqlString = "update skill_thief set skill_chance = " + skillChance + ",eff_lower = " + effLower + ",eff_upper = " + effUpper + " where qqid = " + QQID; mySqlUtil.SetCammandText(SqlString); try { mySqlUtil.ExecuteNonQuery(); IRQQUtil.WritePluginLogFile(logfile, "写入数据库成功(gold)" + DateTime.Now); return(true); } catch (Exception ex) { IRQQUtil.WritePluginLogFile(logfile, "写入数据库失败(gold)" + DateTime.Now); return(false); } }
/// <summary> /// 新增盗贼技能 /// </summary> /// <param name="QQID">qqid</param> /// <param name="skillChance">触发几率</param> /// <param name="effLower">效果下限</param> /// <param name="effUpper">效果上限</param> /// <returns></returns> public static bool AddSkillThiefToDB(string QQID, int skillChance, int effLower, int effUpper) { DataBase.MySqlUtil mySqlUtil = new DataBase.MySqlUtil(); mySqlUtil.SetDBInfo(dbIP, dbName, dbUser, dbPwd, dbPort, dbFile); string SqlString = "insert into skill_thief values(\"" + QQID + "\",\"" + skillChance + "\",\"" + effLower + "\",\"" + effUpper + "\")"; mySqlUtil.SetCammandText(SqlString); try { mySqlUtil.ExecuteNonQuery(); IRQQUtil.WritePluginLogFile(logfile, "增加数据库成功" + DateTime.Now); return(true); } catch (Exception ex) { IRQQUtil.WritePluginLogFile(logfile, "增加数据库失败" + ex + DateTime.Now); return(false); } }