Example #1
0
 public void SaveClass(CTFClass cls)
 {
     if (cls.ID == -1)
     {
         try {
             db.Query("INSERT INTO ctfclasses (Name, Description, HP, " +
                      "Mana, Inventory, Price, Hidden, Sell) " +
                      "VALUES (@0, @1, @2, @3, @4, @5, @6, @7)",
                      cls.Name, cls.Description, cls.HP, cls.Mana, string.Join("~", cls.Inventory),
                      cls.Price, cls.Hidden ? 1 : 0, cls.Sell ? 1 : 0);
         } catch (Exception ex) {
             TShock.Log.Error(ex.ToString());
         }
     }
     else
     {
         try {
             db.Query("UPDATE ctfclasses SET Name = @0, Description = @1, HP = @2, " +
                      "Mana = @3, Inventory = @4, Price = @5, Hidden = @6, Sell = @7 WHERE ID = @8",
                      cls.Name, cls.Description, cls.HP, cls.Mana, string.Join("~", cls.Inventory),
                      cls.Price, cls.Hidden ? 1 : 0, cls.Sell ? 1 : 0, cls.ID);
         } catch (Exception ex) {
             TShock.Log.Error(ex.ToString());
         }
     }
 }
Example #2
0
 public void PickClass(int id, CTFClass cls)
 {
     Debug.Assert(PlayerExists(id));
     Debug.Assert(GameIsRunning);
     players[id].Class = cls;
     tellPlayerCurrentClass(id);
     setInventory(id);
 }
Example #3
0
 public CTFPlayer()
 {
     Team   = CTFTeam.None;
     Class  = null;
     Online = true;
     Dead   = false;
     Data   = new PlayerData(null);
 }