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); } }
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); } }
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); } }