Exemplo n.º 1
0
 public void updateUser(TUser user)
 {
     foreach (TUser usr in Users)
     {
         if (usr.UserID == user.UserID)
         {
             try
             {
                 db.Query("UPDATE Users SET Deaths=@0, MobKills=@1, PvPKills=@2, DmgGiven=@3, DmgTaken=@4 WHERE UserID=@5",
                          user.Deaths,
                          user.MobKills,
                          user.PvPKills,
                          user.DamageGiven,
                          user.DamageRecieved,
                          user.UserID
                          );
             }
             catch (Exception e)
             {
                 Console.WriteLine(e.ToString());
             }
         }
     }
 }
Exemplo n.º 2
0
        void OnPlayerLogin(TShockAPI.Hooks.PlayerPostLoginEventArgs args)
        {
            TUser ply = new TUser(args.Player.Name, args.Player.User.ID, 0, 0, 0, 0, 0);

            DbManager.addUser(ply, args.Player);
        }