Exemple #1
0
        /// <summary>
        /// Determines whether the specified <see cref="GameID"/> is equal to this instance.
        /// </summary>
        /// <param name="gid">The <see cref="GameID"/> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref="GameID"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(GameID gid)
        {
            if (( object )gid == null)
            {
                return(false);
            }

            return(gameid.Data == gid.gameid.Data);
        }
Exemple #2
0
        /// <summary>
        /// Retrieves the number of current players for a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="NumberOfPlayersCallback"/>.</returns>
        public JobID GetNumberOfCurrentPlayers( GameID gameId )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayers>();
            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send( msg );

            return msg.SourceJobID;
        }
        public void PlayGame( GameID game )
        {
            var clientMsg = new ClientMsgProtobuf<CMsgClientGamesPlayed>( EMsg.ClientGamesPlayedNoDataBlob );

            clientMsg.Body.games_played.Add( new CMsgClientGamesPlayed.GamePlayed
            {
                game_id = game,
            } );

            Client.Send( clientMsg );
        }
Exemple #4
0
        /// <summary>
        /// Retrieves the number of current players for a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="NumberOfPlayersCallback"/>.</returns>
        public AsyncJob<NumberOfPlayersCallback> GetNumberOfCurrentPlayers( GameID gameId )
        {
            var msg = new ClientMsg<MsgClientGetNumberOfCurrentPlayers>();
            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send( msg );

            return new AsyncJob<NumberOfPlayersCallback>( this.Client, msg.SourceJobID );
        }
Exemple #5
0
        /// <summary>
        /// Retrieves the number of current players for a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="NumberOfPlayersCallback"/>.</returns>
        public AsyncJob <NumberOfPlayersCallback> GetNumberOfCurrentPlayers(GameID gameId)
        {
            var msg = new ClientMsg <MsgClientGetNumberOfCurrentPlayers>();

            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send(msg);

            return(new AsyncJob <NumberOfPlayersCallback>(this.Client, msg.SourceJobID));
        }
Exemple #6
0
        /// <summary>
        /// Retrieves the number of current players or a given <see cref="GameID"/>.
        /// Results are returned in a <see cref="NumberOfPlayersCallback"/> from a <see cref="SteamClient.JobCallback&lt;T&gt;"/>.
        /// </summary>
        /// <param name="gameId">The GameID to request the number of players for.</param>
        /// <returns>The Job ID of the request. This can be used to find the appropriate <see cref="SteamClient.JobCallback&lt;T&gt;"/>.</returns>
        public JobID GetNumberOfCurrentPlayers(GameID gameId)
        {
            var msg = new ClientMsg <MsgClientGetNumberOfCurrentPlayers>();

            msg.SourceJobID = Client.GetNextJobID();

            msg.Body.GameID = gameId;

            Client.Send(msg);

            return(msg.SourceJobID);
        }
Exemple #7
0
            internal ChatInviteCallback(CMsgClientChatInvite invite)
            {
                this.InvitedID  = invite.steam_id_invited;
                this.ChatRoomID = invite.steam_id_chat;

                this.PatronID = invite.steam_id_patron;

                this.ChatRoomType = ( EChatRoomType )invite.chatroom_type;

                this.FriendChatID = invite.steam_id_friend_chat;

                this.ChatRoomName = invite.chat_name;
                this.GameID       = invite.game_id;
            }
Exemple #8
0
        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(System.Object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            GameID gid = obj as GameID;

            if ((System.Object)gid == null)
            {
                return(false);
            }

            return(gameid.Data == gid.gameid.Data);
        }
Exemple #9
0
 public AsyncJob <NumberOfPlayersCallback> GetNumberOfCurrentPlayers(GameID gameId)
 {
     return(GetNumberOfCurrentPlayers(gameId.AppID));
 }
Exemple #10
0
            internal ChatInviteCallback( CMsgClientChatInvite invite )
            {
                this.InvitedID = invite.steam_id_invited;
                this.ChatRoomID = invite.steam_id_chat;

                this.PatronID = invite.steam_id_patron;

                this.ChatRoomType = ( EChatRoomType )invite.chatroom_type;

                this.FriendChatID = invite.steam_id_friend_chat;

                this.ChatRoomName = invite.chat_name;
                this.GameID = invite.game_id;
            }
Exemple #11
0
 public User()
 {
     GameID = new GameID();
 }
Exemple #12
0
        /// <summary>
        /// Determines whether the specified <see cref="GameID"/> is equal to this instance.
        /// </summary>
        /// <param name="gid">The <see cref="GameID"/> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref="GameID"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals( GameID gid )
        {
            if ( ( object )gid == null )
                return false;

            return gameid.Data == gid.gameid.Data;
        }
Exemple #13
0
 public AsyncJob<NumberOfPlayersCallback> GetNumberOfCurrentPlayers( GameID gameId )
 {
     return GetNumberOfCurrentPlayers( gameId.AppID );
 }