Example #1
0
 private void OnUserStatsReceivedCallback(ref UserStatsReceived_t CallbackData)
 {
     this._id = new SteamID(CallbackData.m_steamIDUser);
     this.InitializeAchievementList(this._requestedAchievements);
     if (this._onUserStatsReceived == null)
     {
         return;
     }
     this._onUserStatsReceived((Stats)null, this);
 }
Example #2
0
 private void OnUserStatsReceivedCallback(ref UserStatsReceived_t CallbackData)
 {
     this.Clear();
     this._id = new SteamID(CallbackData.m_steamIDUser);
     if (this._gameserverStats != IntPtr.Zero)
     {
         foreach (string statName in this._requestedStats)
         {
             int num1;
             if (Stats.SteamUnityAPI_SteamGameServerStats_GetUserStatInt(this._gameserverStats, this._id.ToUInt64(), statName, out num1))
             {
                 this.Add(new Stat(this, statName, (object)num1));
             }
             else
             {
                 float num2;
                 if (Stats.SteamUnityAPI_SteamGameServerStats_GetUserStatFloat(this._gameserverStats, this._id.ToUInt64(), statName, out num2))
                 {
                     this.Add(new Stat(this, statName, (object)num2));
                 }
             }
         }
     }
     else
     {
         foreach (string statName in this._requestedStats)
         {
             int num1;
             if (Stats.SteamUnityAPI_SteamUserStats_GetUserStatInt(this._stats, this._id.ToUInt64(), statName, out num1))
             {
                 this.Add(new Stat(this, statName, (object)num1));
             }
             else
             {
                 float num2;
                 if (Stats.SteamUnityAPI_SteamUserStats_GetUserStatFloat(this._stats, this._id.ToUInt64(), statName, out num2))
                 {
                     this.Add(new Stat(this, statName, (object)num2));
                 }
             }
         }
     }
     this._onUserStatsReceived(this, (Achievements)null);
 }
Example #3
0
 public void RunCallbacks()
 {
   CommunityExpress.SteamUnityAPI_RunCallbacks();
   if (this._gameserver != null && this._gameserver.IsInitialized)
   {
     CommunityExpress.SteamUnityAPI_SteamGameServer_RunCallbacks();
     for (int index = 0; index < this._gameserverUserStatsReceivedCallHandles.Count; ++index)
     {
       ulong callHandle = this._gameserverUserStatsReceivedCallHandles[index];
       byte failed;
       if (CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(callHandle, out failed))
       {
         GSStatsReceived_t result = new GSStatsReceived_t();
         UserStatsReceived_t CallbackData = new UserStatsReceived_t();
         CommunityExpress.SteamUnityAPI_SteamUtils_GetGameServerUserStatsReceivedResult(callHandle, out result, out failed);
         CallbackData.m_nGameID = (ulong) CommunityExpress.SteamUnityAPI_SteamUtils_GetAppID();
         CallbackData.m_steamIDUser = result.m_steamIDUser;
         CallbackData.m_eResult = result.m_eResult;
         this._gameserverUserStatsReceivedCallbacks[index](ref CallbackData);
         this._gameserverUserStatsReceivedCallHandles.RemoveAt(index);
         this._gameserverUserStatsReceivedCallbacks.RemoveAt(index);
         --index;
       }
     }
   }
   if (this._networking != null && this._networking.IsInitialized)
     this._networking.CheckForNewP2PPackets();
   byte failed1;
   if ((long) this._userGetEncryptedAppTicketCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._userGetEncryptedAppTicketCallHandle, out failed1))
   {
     this._userGetEncryptedAppTicketCallback();
     this._userGetEncryptedAppTicketCallHandle = 0UL;
   }
   byte failed2;
   if ((long) this._lobbyCreatedCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyCreatedCallHandle, out failed2))
   {
     LobbyCreated_t result = new LobbyCreated_t();
     CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyCreatedResult(this._lobbyCreatedCallHandle, out result, out failed2);
     this._lobbyCreatedCallback(ref result);
     this._lobbyCreatedCallHandle = 0UL;
   }
   byte failed3;
   if ((long) this._lobbyListReceivedCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyListReceivedCallHandle, out failed3))
   {
     LobbyMatchList_t result = new LobbyMatchList_t();
     CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyListReceivedResult(this._lobbyListReceivedCallHandle, out result, out failed3);
     this._lobbyListReceivedCallback(ref result);
     this._lobbyListReceivedCallHandle = 0UL;
   }
   byte failed4;
   if ((long) this._lobbyJoinedCallHandle == 0L || !CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyJoinedCallHandle, out failed4))
     return;
   LobbyEnter_t result1 = new LobbyEnter_t();
   CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyEnteredResult(this._lobbyJoinedCallHandle, out result1, out failed4);
   this._lobbyJoinedCallback(ref result1);
   this._lobbyJoinedCallHandle = 0UL;
 }
Example #4
0
        public void RunCallbacks()
        {
            CommunityExpress.SteamUnityAPI_RunCallbacks();
            if (this._gameserver != null && this._gameserver.IsInitialized)
            {
                CommunityExpress.SteamUnityAPI_SteamGameServer_RunCallbacks();
                for (int index = 0; index < this._gameserverUserStatsReceivedCallHandles.Count; ++index)
                {
                    ulong callHandle = this._gameserverUserStatsReceivedCallHandles[index];
                    byte  failed;
                    if (CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(callHandle, out failed))
                    {
                        GSStatsReceived_t   result       = new GSStatsReceived_t();
                        UserStatsReceived_t CallbackData = new UserStatsReceived_t();
                        CommunityExpress.SteamUnityAPI_SteamUtils_GetGameServerUserStatsReceivedResult(callHandle, out result, out failed);
                        CallbackData.m_nGameID     = (ulong)CommunityExpress.SteamUnityAPI_SteamUtils_GetAppID();
                        CallbackData.m_steamIDUser = result.m_steamIDUser;
                        CallbackData.m_eResult     = result.m_eResult;
                        this._gameserverUserStatsReceivedCallbacks[index](ref CallbackData);
                        this._gameserverUserStatsReceivedCallHandles.RemoveAt(index);
                        this._gameserverUserStatsReceivedCallbacks.RemoveAt(index);
                        --index;
                    }
                }
            }
            if (this._networking != null && this._networking.IsInitialized)
            {
                this._networking.CheckForNewP2PPackets();
            }
            byte failed1;

            if ((long)this._userGetEncryptedAppTicketCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._userGetEncryptedAppTicketCallHandle, out failed1))
            {
                this._userGetEncryptedAppTicketCallback();
                this._userGetEncryptedAppTicketCallHandle = 0UL;
            }
            byte failed2;

            if ((long)this._lobbyCreatedCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyCreatedCallHandle, out failed2))
            {
                LobbyCreated_t result = new LobbyCreated_t();
                CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyCreatedResult(this._lobbyCreatedCallHandle, out result, out failed2);
                this._lobbyCreatedCallback(ref result);
                this._lobbyCreatedCallHandle = 0UL;
            }
            byte failed3;

            if ((long)this._lobbyListReceivedCallHandle != 0L && CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyListReceivedCallHandle, out failed3))
            {
                LobbyMatchList_t result = new LobbyMatchList_t();
                CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyListReceivedResult(this._lobbyListReceivedCallHandle, out result, out failed3);
                this._lobbyListReceivedCallback(ref result);
                this._lobbyListReceivedCallHandle = 0UL;
            }
            byte failed4;

            if ((long)this._lobbyJoinedCallHandle == 0L || !CommunityExpress.SteamUnityAPI_SteamUtils_IsAPICallCompleted(this._lobbyJoinedCallHandle, out failed4))
            {
                return;
            }
            LobbyEnter_t result1 = new LobbyEnter_t();

            CommunityExpress.SteamUnityAPI_SteamUtils_GetLobbyEnteredResult(this._lobbyJoinedCallHandle, out result1, out failed4);
            this._lobbyJoinedCallback(ref result1);
            this._lobbyJoinedCallHandle = 0UL;
        }