Exemplo n.º 1
0
 public static void bst_2_create_player(RecordBSTAccount a, RecordBSTBase b, string custom, string last_tips)
 {
     using (MySqlConnection conn = new MySqlConnection(ConnStr)) {
         conn.Open();
         string query = "INSERT INTO bst_player2_data VALUES (" +
                        $"\"{a.rid}\", {a.usrid}, {a.is_takeover}, {a.tpc}, {a.dpc}, {a.crd}, {a.brd}, {a.tdc}, \"{a.lid}\", {a.mode}, {a.ver}, {a.pp}, {a.ps}, {a.pay}, {a.pay_pc}, {a.st}, " +
                        $"\"{b.name}\", {b.brnk}, {b.bcnum}, {b.lcnum}, {b.volt}, {b.gold}, {b.lmid}, {b.lgrd}, {b.lsrt}, {b.ltab}, {b.splv}, {b.pref}, {b.lcid}, {b.hat}, " +
                        $"\"{custom}\", {last_tips})";
         MySqlCommand cmd = new MySqlCommand(query, conn);
         cmd.ExecuteNonQuery();
         foreach (int i in Enumerable.Range(0, 61))
         {
             query =
                 $"INSERT INTO bst_player2_hacker (refid, id, state0, state1, state2, state3, state4) VALUES (\"{a.rid}\", {i}, 0, 0, 0, 0, 0)";
             cmd = new MySqlCommand(query, conn);
             cmd.ExecuteNonQuery();
         }
     }
 }
Exemplo n.º 2
0
 public static void bst_2_write_player(RecordBSTAccount a, RecordBSTBase b, string custom, string last_tips)
 {
     using (MySqlConnection conn = new MySqlConnection(ConnStr)) {
         conn.Open();
         string query = "UPDATE bst_player2_data SET " +
                        $"usrid = {a.usrid}, " +
                        $"is_takeover = {a.is_takeover}, " +
                        $"tpc = {a.tpc}, " +
                        $"dpc = {a.dpc}, " +
                        $"crd = {a.crd}, " +
                        $"brd = {a.brd}, " +
                        $"tdc = {a.tdc}, " +
                        $"lid = \"{a.lid}\", " +
                        $"mode = {a.mode}, " +
                        $"ver = {a.ver}, " +
                        $"pp = {a.pp}, " +
                        $"ps = {a.ps}, " +
                        $"pay = pay + {a.pay}, " +
                        $"pay_pc = pay_pc + {a.pay_pc}, " +
                        $"st = {a.st}, " +
                        $"name = \"{b.name}\", " +
                        $"brnk = {b.brnk}, " +
                        $"bcnum = {b.bcnum}, " +
                        $"lcnum = {b.lcnum}, " +
                        $"volt = {b.volt}, " +
                        $"gold = {b.gold}, " +
                        $"lmid = {b.lmid}, " +
                        $"lgrd = {b.lgrd}, " +
                        $"lsrt = {b.lsrt}, " +
                        $"ltab = {b.ltab}, " +
                        $"splv = {b.splv}, " +
                        $"pref = {b.pref}, " +
                        $"lcid = {b.lcid}, " +
                        $"hat = {b.hat}, " +
                        $"custom = \"{custom}\", " +
                        $"last_tips = {last_tips} WHERE refid = \"{a.rid}\"";
         MySqlCommand cmd = new MySqlCommand(query, conn);
         cmd.ExecuteNonQuery();
     }
 }