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


C# SteamID.Set方法代码示例

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


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

示例1: OnLoginCompleted

        public override bool OnLoginCompleted()
        {
            XmlDocument xmlDocument = new XmlDocument();
            try
            {
                BotManager.mainLog.Success("Loading config.xml file...");
                xmlDocument.Load("config.xml");
            }
            catch (System.Exception ex)
            {
                BotManager.mainLog.Error(ex.ToString());
                Bot.StopBot();
                return false;
            }

            clanID = new SteamID();
            clanID.Set(uint.Parse(readElement(xmlDocument, "Steam/groupID")), EUniverse.Public, EAccountType.Clan);

            CSWebClient = new WebClient();
            CSWebClient.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) " + "(compatible; MSIE 6.0; Windows NT 5.1; " + ".NET CLR 1.1.4322; .NET CLR 2.0.50727)";

            CSWebClientPeriodic = new WebClient();
            CSWebClientPeriodic.Headers["User-Agent"] = "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) " + "(compatible; MSIE 6.0; Windows NT 5.1; " + ".NET CLR 1.1.4322; .NET CLR 2.0.50727)";

            random = new System.Random((int)System.DateTime.Now.Ticks);

            conversionRate = 1.0; //will update correctly every now and then

            Moolah_guid = readElement(xmlDocument, "Moolah/guid");
            Moolah_api_key = readElement(xmlDocument, "Moolah/api_key");

            string sql_server = readElement(xmlDocument, "SQL/server");
            string sql_id = readElement(xmlDocument, "SQL/id");
            string sql_password = readElement(xmlDocument, "SQL/password");
            string sql_database = readElement(xmlDocument, "SQL/database");
            mysql_connection = new MySqlConnection("SERVER=" + sql_server +
                                                "; DATABASE=" + sql_database +
                                                "; UID=" + sql_id +
                                                "; PASSWORD=" + sql_password + ";");
            try
            {
                BotManager.mainLog.Success("Trying to connect to MySQL server...");
                mysql_connection.Open();
            }
            catch (MySqlException ex)
            {
                BotManager.mainLog.Error(ex.ToString());
                Bot.StopBot();
                return false;
            }

            returnQuery("CREATE TABLE IF NOT EXISTS users ( userID int NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
                                                                        "SteamID64 BIGINT NOT NULL, " +
                                                                        "balance DOUBLE(30,15) NOT NULL, " +
                                                                        "responded TINYINT(1) NOT NULL," +
                                                                        "username TEXT )");

            returnQuery("CREATE TABLE IF NOT EXISTS tips ( tipID int NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
                                                                        "senderID64 BIGINT NOT NULL, " +
                                                                        "receiverID64 BIGINT NOT NULL, " +
                                                                        "amount DOUBLE(30,15) NOT NULL, " +
                                                                        "label TEXT, " +
                                                                        "notified TINYINT(1) NOT NULL, " +
                                                                        "donation TINYINT(1) NOT NULL, " +
                                                                        "anonymous TINYINT(1) NOT NULL, " +
                                                                        "message TEXT, " +
                                                                        "timestamp TIMESTAMP )");

            returnQuery("CREATE TABLE IF NOT EXISTS add_verification ( addID int NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
                                                                        "userID int(11) NOT NULL, " +
                                                                        "amount DOUBLE(30,15) NOT NULL, " +
                                                                        "add_code TEXT NOT NULL, " +
                                                                        "verified TINYINT(1) NOT NULL )");

            returnQuery("CREATE TABLE IF NOT EXISTS aliases ( aliasID int NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
                                                                        "userID64 BIGINT NOT NULL, " +
                                                                        "aliasID64 BIGINT NOT NULL, " +
                                                                        "alias TEXT NOT NULL )");

            try
            {
                System.ComponentModel.BackgroundWorker addValidityWorker = new System.ComponentModel.BackgroundWorker();
                addValidityWorker.DoWork += checkPeriodically;
                addValidityWorker.RunWorkerAsync();
            }
            catch (System.Exception e)
            {
                BotManager.mainLog.Error(e.ToString());
                Bot.StopBot();
                return false;
            }

            //prices in Dollars
            labels = new DogeLabel[]{   new DogeLabel(1, "beer","a beer",DogeLabel.Currency.USD),
                                        new DogeLabel(2.4, "key","a Dota 2 treasure key",DogeLabel.Currency.USD),
                                        new DogeLabel(25, "dominions4","Dominions 4",DogeLabel.Currency.USD),
                                        new DogeLabel(420, "fedora","one fedora",DogeLabel.Currency.DOGE)};

            //remove all friends on every
            int friendCount = Bot.SteamFriends.GetFriendCount();
//.........这里部分代码省略.........
开发者ID:natoshi,项目名称:steamdogebot,代码行数:101,代码来源:DogeTipBotHandler.cs

示例2: SetValidAndHandlesClan

        public void SetValidAndHandlesClan()
        {
            SteamID sid = new SteamID();

            sid.Set( 1234u, EUniverse.Internal, EAccountType.ContentServer );

            Assert.Equal( 1234u, sid.AccountID );
            Assert.Equal( EUniverse.Internal, sid.AccountUniverse );
            Assert.Equal( EAccountType.ContentServer, sid.AccountType );
            Assert.Equal( SteamID.DesktopInstance, sid.AccountInstance );


            sid.Set( 4321u, EUniverse.Public, EAccountType.Clan );

            Assert.Equal( 4321u, sid.AccountID );
            Assert.Equal( EUniverse.Public, sid.AccountUniverse );
            Assert.Equal( EAccountType.Clan, sid.AccountType );
            Assert.Equal( 0u, sid.AccountInstance );
        }
开发者ID:ChronosWS,项目名称:SteamKit,代码行数:19,代码来源:SteamIDFacts.cs


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