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


C# CSteamID类代码示例

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


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

示例1: 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

示例2: execute

        protected override void execute( CSteamID executorId, string parameter )
        {
            try
            {
                var commandSource = executorId == CSteamID.Nil
                                    ? EssProvider.ConsoleSource
                                    : UPlayer.From( executorId );

                if ( commandSource.IsConsole && Command.AllowedSource == AllowedSource.PLAYER )
                {
                    EssLang.CONSOLE_CANNOT_EXECUTE.SendTo( commandSource );
                }
                else if ( !commandSource.IsConsole && Command.AllowedSource == AllowedSource.CONSOLE )
                {
                    EssLang.PLAYER_CANNOT_EXECUTE.SendTo( commandSource );
                }
                else
                {
                    Command.OnExecute( commandSource , new CommandArgs( parameter ) );
                }
            }
            catch ( Exception e )
            {
                UPlayer.TryGet( executorId, EssLang.COMMAND_ERROR_OCURRED.SendTo );

                EssProvider.Logger.LogError( e.ToString() );
            }
        }
开发者ID:gitter-badger,项目名称:uEssentials,代码行数:28,代码来源:CommandAdapter.cs

示例3: ClearUser

 public void ClearUser(CSteamID id)
 {
     lock (this._pendingReadBuffers)
     {
         this._deletionQueue.Enqueue(id);
     }
 }
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:7,代码来源:SteamP2PReader.cs

示例4: 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

示例5: ActivateGameOverlayToUser

 public static void ActivateGameOverlayToUser(string pchDialog, CSteamID steamID)
 {
     InteropHelp.TestIfAvailableClient();
     using (InteropHelp.UTF8StringHandle uTF8StringHandle = new InteropHelp.UTF8StringHandle(pchDialog))
     {
         NativeMethods.ISteamFriends_ActivateGameOverlayToUser(uTF8StringHandle, steamID);
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:8,代码来源:SteamFriends.cs

示例6: tellToggleHud

 //[SteamCall]
 public void tellToggleHud(CSteamID steamID, bool visible)
 {
     if (base.channel.checkServer(steamID))
     {
         Debug.LogError("CALLED HUD");
         this.visible = visible;
     }
 }
开发者ID:RocketMod,项目名称:Rocket.Unturned,代码行数:9,代码来源:HUD.cs

示例7: SetInvitedToGameId

 public void SetInvitedToGameId(ulong gameId)
 {
     CSteamID y = new CSteamID(gameId);
     if (y.IsValid() && (CoopLobby.Instance == null || CoopLobby.Instance.Info.LobbyId != y))
     {
         base.StartCoroutine(this.DelayedInviteReceived(new CoopLobbyInfo(gameId)));
     }
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:8,代码来源:AutoJoinAfterMPInvite.cs

示例8: ClearInventory

        private void ClearInventory(UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer)
        {
            if (!player.HasPermission ("keepinventory.keep"))
            {
                return;
            }

            var playerInventory = player.Inventory;
            List<Item> ids = new List<Item> ();
            List<Item> clothes = new List<Item> ();

            // "Remove "models" of items from player "body""
            player.Player.channel.send ("tellSlot", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, ( byte ) 0, ( byte ) 0, new byte[0]);
            player.Player.channel.send ("tellSlot", ESteamCall.ALL, ESteamPacket.UPDATE_RELIABLE_BUFFER, ( byte ) 1, ( byte ) 0, new byte[0]);

            // Remove items
            for (byte page = 0; page < 8; page++)
            {
                var count = playerInventory.getItemCount (page);

                for (byte index = 0; index < count; index++)
                {
                    ids.Add (playerInventory.getItem (page, 0).item);
                    playerInventory.removeItem (page, 0);
                }
            }

            // Unequip & remove from inventory
            player.Player.clothing.askWearBackpack (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearGlasses (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearHat (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearPants (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearMask (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearShirt (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));

            player.Player.clothing.askWearVest (0, 0, new byte[0], true);
            clothes.Add (removeUnequipped (playerInventory));
            clothes.AddRange (ids);
            deadAdmins.Add (player);
            adminItems.Add (player, clothes);
        }
开发者ID:FaizanDurrani,项目名称:KeepInventory,代码行数:52,代码来源:Main.cs

示例9: OnPlayerDeath

        internal void OnPlayerDeath( UnturnedPlayer player, EDeathCause cause, ELimb limb, 
                                     CSteamID murderer )
        {
            if ( !player.HasPermission( "essentials.command.back" ) )
                return;

            var displayName = player.DisplayName;

            if ( BackDict.ContainsKey( displayName ) )
                BackDict.Remove( displayName );

            BackDict.Add( displayName, player.Position );
        }
开发者ID:gitter-badger,项目名称:uEssentials,代码行数:13,代码来源:CommandBack.cs

示例10: Party

        public Party(UnturnedPlayer leader)
        {
            //create the party's fake steam group
            var buffer = new byte[sizeof(ulong)];
            random.NextBytes(buffer);
            ulong newID = BitConverter.ToUInt64(buffer, 0);
            steamGroup = new CSteamID(newID);
            claimedIDs.Add(newID);

            //set and add the leader
            this.leader = leader;
            leader.Player.SteamChannel.SteamPlayer.playerID.SteamGroupID = steamGroup;
            members.Add(leader);
        }
开发者ID:jcvl92,项目名称:DingusGamingUnturnedPlugin,代码行数:14,代码来源:Party.cs

示例11: ClearUser

		public void ClearUser(CSteamID user)
		{
			lock (this._lock)
			{
				if (this._pendingSendData.ContainsKey(user))
				{
					Queue<SteamP2PWriter.WriteInformation> item = this._pendingSendData[user];
					while (item.Count > 0)
					{
						this._bufferPool.Enqueue(item.Dequeue().Data);
					}
				}
			}
		}
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:14,代码来源:SteamP2PWriter.cs

示例12: IsDataAvailable

 public bool IsDataAvailable(CSteamID id)
 {
     bool flag;
     lock (this._pendingReadBuffers)
     {
         if (this._pendingReadBuffers.ContainsKey(id))
         {
             Queue<SteamP2PReader.ReadResult> item = this._pendingReadBuffers[id];
             flag = (item.Count == 0 || item.Peek().Size == 0 ? false : true);
         }
         else
         {
             flag = false;
         }
     }
     return flag;
 }
开发者ID:Celant,项目名称:TerrariaAPI-Server,代码行数:17,代码来源:SteamP2PReader.cs

示例13: execute

 protected override void execute(CSteamID executorID, string parameter)
 {
     CommandQueue queue = ExecScript.ToQueue(UnturnedFreneticMod.Instance.CommandSystem.System);
     MapTag map = new MapTag();
     if (executorID == CSteamID.Nil)
     {
         map.Internal["is_server"] = new BooleanTag(true);
     }
     else
     {
         map.Internal["player"] = new PlayerTag(PlayerTool.getSteamPlayer(executorID));
         map.Internal["is_server"] = new BooleanTag(false);
     }
     map.Internal["raw_arguments"] = new TextTag(parameter);
     queue.SetVariable("context", map);
     queue.CommandStack.Peek().Debug = DebugMode.MINIMAL; // Just in case
     queue.Execute();
 }
开发者ID:FreneticXYZ,项目名称:UnturnedFrenetic,代码行数:18,代码来源:UnturnedCustomCommand.cs

示例14: 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

示例15: CheckParameters

		private void CheckParameters()
		{
			ulong ulSteamID;
			if (Program.LaunchParameters.ContainsKey("+connect_lobby") && ulong.TryParse(Program.LaunchParameters["+connect_lobby"], out ulSteamID))
			{
				CSteamID lobbySteamId = new CSteamID(ulSteamID);
				if (lobbySteamId.IsValid())
				{
					Main.OpenPlayerSelect(delegate(PlayerFileData playerData)
					{
						Main.ServerSideCharacter = false;
						playerData.SetAsActive();
						Main.menuMode = 882;
						Main.statusText = "Joining...";
						this._lobby.Join(lobbySteamId, new CallResult<LobbyEnter_t>.APIDispatchDelegate(this.OnLobbyEntered));
					});
				}
			}
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:19,代码来源:NetClientSocialModule.cs


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