当前位置: 首页>>代码示例>>C#>>正文


C# CSteamID.ToString方法代码示例

本文整理汇总了C#中CSteamID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# CSteamID.ToString方法的具体用法?C# CSteamID.ToString怎么用?C# CSteamID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSteamID的用法示例。


在下文中一共展示了CSteamID.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddUpdateVictimAccount

 public void AddUpdateVictimAccount(CSteamID id, decimal bounty, string lastDisplayName)
 {
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         if (CheckExists(id))
         {
             command.CommandText = "UPDATE `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` SET `bounty` = bounty + (" + bounty + "), `lastDisplayName` = @lastDisplayName, `lastUpdated` = NOW() WHERE `steamId` = '" + id.ToString() + "';";
         }
         else
         {
             command.CommandText = "INSERT IGNORE INTO `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` (steamId,bounty,lastDisplayName,lastUpdated) VALUES('" + id.ToString() + "','" + bounty + "',@lastDisplayName,NOW());";
         }
         command.Parameters.AddWithValue("@lastDisplayName", lastDisplayName);
         connection.Open();
         IAsyncResult result = command.BeginExecuteNonQuery();
         command.EndExecuteNonQuery(result);
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:25,代码来源:FeexHitmanDatabase.cs

示例2: GetWarnings

 public byte GetWarnings(CSteamID id)
 {
     byte num = 0;
     try
     {
         MySqlConnection mySqlConnection = this.createConnection();
         MySqlCommand mySqlCommand = mySqlConnection.CreateCommand();
         mySqlCommand.CommandText = string.Concat(new string[] { 
             "select `warninglevel` from `",
             Zaup_Warning.Instance.Configuration.Instance.TableName,
             "` where `steamId` = '",
             id.ToString(),
             "';" 
         });
         mySqlConnection.Open();
         object obj = mySqlCommand.ExecuteScalar();
         if (obj != null)
         {
             byte.TryParse(obj.ToString(), out num);
         }
         mySqlConnection.Close();
     }
     catch (Exception exception)
     {
         Logger.LogException(exception);
     }
     return num;
 }
开发者ID:ClassyDestroyer,项目名称:Zaup_Warning,代码行数:28,代码来源:DatabaseMgr.cs

示例3: GetBounty

 public decimal GetBounty(CSteamID id)
 {
     decimal output = 0;
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         command.CommandText = "SELECT `bounty` FROM `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` WHERE `steamId` = '" + id.ToString() + "';";
         connection.Open();
         object result = command.ExecuteScalar();
         if (result != null) Decimal.TryParse(result.ToString(), out output);
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
     return output;
 }
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:19,代码来源:FeexHitmanDatabase.cs

示例4: CheckAccount

        public bool CheckAccount(CSteamID id)
        {
            try
            {
                MySqlConnection connection = CreateConnection();
                MySqlCommand command = connection.CreateCommand();
                int exists = 0;
                connection.Open();
                command.CommandText = "SELECT COUNT(1) FROM `" + FeexRanks.Instance.Configuration.Instance.FeexRanksDatabase.DatabaseTableName + "` WHERE `steamId` = '" + id.ToString() + "'";
                object result = command.ExecuteScalar();
                if (result != null) Int32.TryParse(result.ToString(), out exists);
                connection.Close();

                if (exists == 0) { return false; }
                else { return true; }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return false;
            }
        }
开发者ID:jorea143,项目名称:FeexRanks,代码行数:22,代码来源:FeexRanksDatabase.cs

示例5: UpdateDisplayName

 public void UpdateDisplayName(CSteamID id, string lastDisplayName)
 {
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         command.CommandText = "UPDATE `" + FeexRanks.Instance.Configuration.Instance.FeexRanksDatabase.DatabaseTableName + "` SET `lastDisplayName` = '" + lastDisplayName + "' WHERE `steamId` = '" + id.ToString() + "'";
         connection.Open();
         command.ExecuteNonQuery();
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
开发者ID:jorea143,项目名称:FeexRanks,代码行数:16,代码来源:FeexRanksDatabase.cs

示例6: UpdateAccount

 public void UpdateAccount(CSteamID id, int points)
 {
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         connection.Open();
         command.CommandText = "UPDATE `" + FeexRanks.Instance.Configuration.Instance.FeexRanksDatabase.DatabaseTableName + "` SET `points`=`points`+" + points + " WHERE `steamId`='" + id.ToString() + "'";
         command.ExecuteNonQuery();
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
开发者ID:jorea143,项目名称:FeexRanks,代码行数:16,代码来源:FeexRanksDatabase.cs

示例7: GetAccountBySteamID

 public string[] GetAccountBySteamID(CSteamID id)
 {
     string[] output = new string[3];
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = new MySqlCommand("SELECT * FROM `" + FeexRanks.Instance.Configuration.Instance.FeexRanksDatabase.DatabaseViewName + "` WHERE `steamId` = '" + id.ToString() + "'", connection);
         connection.Open();
         MySqlDataReader dataReader = command.ExecuteReader();
         while (dataReader.Read())
         {
             output[0] = Convert.ToString(dataReader["points"]);
             output[1] = Convert.ToString(dataReader["currentRank"]);
             output[2] = Convert.ToString(dataReader["lastDisplayName"]);
         }
         dataReader.Close();
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
     return output;
 }
开发者ID:jorea143,项目名称:FeexRanks,代码行数:24,代码来源:FeexRanksDatabase.cs

示例8: Say

 public static void Say(CSteamID CSteamID, string message, Color color)
 {
     if (CSteamID == null || CSteamID.ToString() == "0")
     {
         Core.Logging.Logger.Log(message, ConsoleColor.Gray);
     }
     else
     {   
         foreach (string m in wrapMessage(message))
         {
             ChatManager.instance.channel.send("tellChat", CSteamID, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[] { CSteamID.Nil, (byte)EChatMode.SAY,color, m });
         }
     }
 }
开发者ID:RocketMod,项目名称:Rocket.Unturned,代码行数:14,代码来源:UnturnedChat.cs

示例9: Say

 public static void Say(CSteamID CSteamID, string message, Color color)
 {
     if (CSteamID == null || CSteamID.ToString() == "0")
     {
         System.Console.ForegroundColor = ConsoleColor.Gray;
         System.Console.WriteLine(message);
         Logger.Log(message,false);
     }
     else
     {   
         foreach (string m in wrapMessage(message))
         {
             ChatManager.Instance.SteamChannel.send("tellChat", CSteamID, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[] { CSteamID.Nil, (byte)EChatMode.SAY,color, m });
         }
     }
 }
开发者ID:KhrumoX,项目名称:Rocket.Unturned,代码行数:16,代码来源:UnturnedChat.cs

示例10: GetWarningsTime

 public ushort GetWarningsTime(CSteamID id)
 {
     ushort num = 0;
     try
     {
         MySqlConnection mySqlConnection = this.createConnection();
         MySqlCommand mySqlCommand = mySqlConnection.CreateCommand();
         mySqlCommand.CommandText = string.Concat(new string[] { 
             "select timestampdiff(day, now(), 'select `lastwarningdate` from `",
             Zaup_Warning.Instance.Configuration.Instance.TableName,
             "` where `steamId` = '",
             id.ToString(),
             "' ');" 
         });
         mySqlConnection.Open();
         object obj = mySqlCommand.ExecuteScalar();
         if (obj != null)
         {
             ushort.TryParse(obj.ToString(), out num);
         }
         mySqlConnection.Close();
     }
     catch (Exception exception)
     {
         Logger.LogException(exception);
     }
     return num;
 }
开发者ID:ClassyDestroyer,项目名称:Zaup_Warning,代码行数:28,代码来源:DatabaseMgr.cs

示例11: EditWarning

 public bool EditWarning(CSteamID id, short amt = 1)
 {
     bool success = false;
     try
     {
         MySqlConnection mySqlConnection = this.createConnection();
         MySqlCommand mySqlCommand = mySqlConnection.CreateCommand();
         mySqlCommand.CommandText = string.Concat(new string[] { 
             "insert into `" +
         Zaup_Warning.Instance.Configuration.Instance.TableName +
         "` (steamId, warninglevel) VALUES ('" + id.ToString() + "', 1) on duplicate key update `warninglevel`=`warninglevel`+ " + 
         amt.ToString()
         });
         mySqlConnection.Open();
         int affected = mySqlCommand.ExecuteNonQuery();
         mySqlConnection.Close();
         if (affected > 0) success = true;
     }
     catch (Exception exception)
     {
         Logger.LogException(exception);
     }
     return success;
 }
开发者ID:ClassyDestroyer,项目名称:Zaup_Warning,代码行数:24,代码来源:DatabaseMgr.cs

示例12: UpdateVictimDisplayName

 public void UpdateVictimDisplayName(CSteamID id, string lastDisplayName)
 {
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         command.CommandText = "UPDATE `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` SET `lastDisplayName` = @lastDisplayName WHERE `steamId` = '" + id.ToString() + "';";
         command.Parameters.AddWithValue("@lastDisplayName", lastDisplayName);
         connection.Open();
         IAsyncResult result = command.BeginExecuteNonQuery();
         command.EndExecuteNonQuery(result);
         connection.Close();
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:18,代码来源:FeexHitmanDatabase.cs

示例13: RemoveVictimAccount

 public bool RemoveVictimAccount(CSteamID id)
 {
     try
     {
         MySqlConnection connection = CreateConnection();
         MySqlCommand command = connection.CreateCommand();
         command.CommandText = "DELETE FROM `" + FeexHitman.Instance.Configuration.Instance.FeexHitmanDatabase.DatabaseTableName + "` WHERE `steamId`='" + id.ToString() + "';";
         connection.Open();
         IAsyncResult result = command.BeginExecuteNonQuery();
         command.EndExecuteNonQuery(result);
         connection.Close();
         return true;
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
         return false;
     }
 }
开发者ID:Freenex1911,项目名称:FeexHitman,代码行数:19,代码来源:FeexHitmanDatabase.cs


注:本文中的CSteamID.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。