public override void LoadFriendsList()
        {
            gameServiceFriendsList = new List <GameServiceUserInfo>();

            int friendCount = SteamFriends.GetFriendCount(EFriendFlags.k_EFriendFlagImmediate);

            for (int i = 0; i < friendCount; ++i)
            {
                CSteamID         friendSteamId = SteamFriends.GetFriendByIndex(i, EFriendFlags.k_EFriendFlagImmediate);
                string           friendName    = SteamFriends.GetFriendPersonaName(friendSteamId);
                EPersonaState    friendState   = SteamFriends.GetFriendPersonaState(friendSteamId);
                FriendGameInfo_t currentGame;


                if (SteamFriends.GetFriendGamePlayed(friendSteamId, out currentGame))
                {
                    if (currentGame.m_gameID == m_GameID)
                    {
                        GameServiceUserInfo friend = new GameServiceUserInfo();
                        friend.NickName = friendName;
                        friend.PlayerId = friendSteamId.GetAccountID().m_AccountID.ToString();
                        friend.Status   = Status.Available;
                        friend.SetAvatarFromTexture2D(GetSmallAvatar(friendSteamId, false));
                        gameServiceFriendsList.Add(friend);
                    }
                }
            }

            RaiseGameServiceEvent(new GameServiceEvent(GameServiceEventType.FriendsListReady));
        }
Пример #2
0
 private void WorkshopTool_Load(object sender, EventArgs e)
 {
     steamId   = SteamUser.GetSteamID();
     accountId = steamId.GetAccountID();
     for (int index = 0; index < CmdlineArgs.Count(); index++)
     {
         if (CmdlineArgs[index] == "-nodelete")
         {
             bDontDeleteTempFiles = true;
         }
     }
     workshopTextBox1.PrintLine("Use 'quit' or 'exit' to exit WorkshopTool.  Use 'help' to get help.");
     workshopTextBox1.PrintPrompt();
 }
Пример #3
0
    void QueryPersonalWorkshopItems()
    {
        CSteamID userid = SteamUser.GetSteamID();

        UGCQueryHandle_t query_handle = SteamUGC.CreateQueryUserUGCRequest(
            userid.GetAccountID(),
            EUserUGCList.k_EUserUGCList_Subscribed,
            EUGCMatchingUGCType.k_EUGCMatchingUGCType_All,
            EUserUGCListSortOrder.k_EUserUGCListSortOrder_TitleAsc,
            RECEIVER1_APP_ID,
            RECEIVER1_APP_ID,
            1
            );

        SteamAPICall_t call = SteamUGC.SendQueryUGCRequest(query_handle);

        m_callSteamUGCQueryCompleted.Set(call);
    }
Пример #4
0
        public static string Format(this CSteamID steamID)
        {
            if (steamID.GetEAccountType() == EAccountType.k_EAccountTypeInvalid ||
                steamID.GetEAccountType() == EAccountType.k_EAccountTypeIndividual)
            {
                uint accountID = steamID.GetAccountID().m_AccountID;

                if (steamID.GetEUniverse() <= EUniverse.k_EUniversePublic)
                {
                    return(string.Format("STEAM_0:{0}:{1}", accountID & 1, accountID >> 1));
                }
                else
                {
                    return(string.Format("STEAM_{2}:{0}:{1}", accountID & 1, accountID >> 1,
                                         (int)steamID.GetEUniverse()));
                }
            }
            else
            {
                return(steamID.ToString());
            }
        }
Пример #5
0
        public static string GetSteamID3()
        {
            // fill out the CSteamID structure with our own SteamID
            // via the SteamUser interface
            CSteamID steamID = SteamUser.GetSteamID();

            // returning the required information from the CSteamID struct
            // to form the SteamID3
            // U = EUniverse, I exclude this, because it will always be 1.
            // {0} = EAccountType, this *should* always be 1, however, it depends on the account, so I get it just incase.
            // {1} = the AccountID, this is 32bits long, and is completely unique per account.
            // the output should be something like [U:1:XXXXXXXX]
            return(string.Format("SteamID3: [U:{0}:{1}]\n", (int)steamID.GetEAccountType(), steamID.GetAccountID()));
        }