예제 #1
0
 public void SetPoints(string steamId, int points)
 {
     try
     {
         AddSetPointsParameter classAddSetPointsParameter = new AddSetPointsParameter(steamId, points);
         ThreadPool.QueueUserWorkItem
             (new WaitCallback(SetPointsThread), classAddSetPointsParameter);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
예제 #2
0
 public void AddPoints(string steamId, int points)
 {
     try
     {
         AddSetPointsParameter classAddSetPointsParameter = new AddSetPointsParameter(steamId, points);
         ThreadPool.QueueUserWorkItem
             (new WaitCallback(AddPointsThread), classAddSetPointsParameter);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
예제 #3
0
 private void SetPointsThread(object objectAddSetPointsParameter)
 {
     try
     {
         AddSetPointsParameter classAddSetPointsParameter = (AddSetPointsParameter)objectAddSetPointsParameter;
         MySqlConnection       connection = CreateConnection();
         MySqlCommand          command    = connection.CreateCommand();
         command.CommandText = "UPDATE `" + Init.Instance.Configuration.Instance.PDatabaseTableName + "` SET `points`=" + classAddSetPointsParameter.points.ToString() + " WHERE `steamId`=@steamId;";
         command.Parameters.AddWithValue("@steamId", classAddSetPointsParameter.steamId);
         connection.Open();
         command.ExecuteNonQuery();
         connection.Dispose();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }