// Token: 0x06000B44 RID: 2884 RVA: 0x003CD434 File Offset: 0x003CB634
        private bool OnPacketRead(byte[] data, int length, CSteamID userId)
        {
            if (!this._connectionStateMap.ContainsKey(userId) || this._connectionStateMap[userId] == NetSocialModule.ConnectionState.Inactive)
            {
                P2PSessionRequest_t result;
                result.m_steamIDRemote = userId;
                this.OnP2PSessionRequest(result);
                if (!this._connectionStateMap.ContainsKey(userId) || this._connectionStateMap[userId] == NetSocialModule.ConnectionState.Inactive)
                {
                    return(false);
                }
            }
            NetSocialModule.ConnectionState connectionState = this._connectionStateMap[userId];
            if (connectionState != NetSocialModule.ConnectionState.Authenticating)
            {
                return(connectionState == NetSocialModule.ConnectionState.Connected);
            }
            if (length < 3)
            {
                return(false);
            }
            if (((int)data[1] << 8 | (int)data[0]) != length)
            {
                return(false);
            }
            if (data[2] != 93)
            {
                return(false);
            }
            byte[] array = new byte[data.Length - 3];
            Array.Copy(data, 3, array, 0, array.Length);
            switch (SteamUser.BeginAuthSession(array, array.Length, userId))
            {
            case EBeginAuthSessionResult.k_EBeginAuthSessionResultOK:
                this._connectionStateMap[userId] = NetSocialModule.ConnectionState.Connected;
                this.BroadcastConnectedUsers();
                break;

            case EBeginAuthSessionResult.k_EBeginAuthSessionResultInvalidTicket:
                this.Close(userId);
                break;

            case EBeginAuthSessionResult.k_EBeginAuthSessionResultDuplicateRequest:
                this.Close(userId);
                break;

            case EBeginAuthSessionResult.k_EBeginAuthSessionResultInvalidVersion:
                this.Close(userId);
                break;

            case EBeginAuthSessionResult.k_EBeginAuthSessionResultGameMismatch:
                this.Close(userId);
                break;

            case EBeginAuthSessionResult.k_EBeginAuthSessionResultExpiredTicket:
                this.Close(userId);
                break;
            }
            return(false);
        }
        private bool OnPacketRead(byte[] data, int length, CSteamID userId)
        {
            if (!this._connectionStateMap.ContainsKey(userId) || this._connectionStateMap[userId] == NetSocialModule.ConnectionState.Inactive)
            {
                P2PSessionRequest_t result;
                result.m_steamIDRemote = (__Null)userId;
                this.OnP2PSessionRequest(result);
                if (!this._connectionStateMap.ContainsKey(userId) || this._connectionStateMap[userId] == NetSocialModule.ConnectionState.Inactive)
                {
                    return(false);
                }
            }
            NetSocialModule.ConnectionState connectionState = this._connectionStateMap[userId];
            if (connectionState != NetSocialModule.ConnectionState.Authenticating)
            {
                return(connectionState == NetSocialModule.ConnectionState.Connected);
            }
            if (length < 3 || ((int)data[1] << 8 | (int)data[0]) != length || (int)data[2] != 93)
            {
                return(false);
            }
            byte[] numArray = new byte[data.Length - 3];
            Array.Copy((Array)data, 3, (Array)numArray, 0, numArray.Length);
            switch ((int)SteamUser.BeginAuthSession(numArray, numArray.Length, userId))
            {
            case 0:
                this._connectionStateMap[userId] = NetSocialModule.ConnectionState.Connected;
                this.BroadcastConnectedUsers();
                break;

            case 1:
                this.Close(userId);
                break;

            case 2:
                this.Close(userId);
                break;

            case 3:
                this.Close(userId);
                break;

            case 4:
                this.Close(userId);
                break;

            case 5:
                this.Close(userId);
                break;
            }
            return(false);
        }
Exemple #3
0
 private bool OnPacketRead(byte[] data, int size, RailID user)
 {
     if (!this.IsActiveUser(user))
     {
         WeGameHelper.WriteDebugString("OnPacketRead IsActiveUser false");
         return(false);
     }
     NetSocialModule.ConnectionState connectionState = this._connectionStateMap[user];
     if (connectionState != NetSocialModule.ConnectionState.Authenticating)
     {
         return(connectionState == NetSocialModule.ConnectionState.Connected);
     }
     if (!this.TryAuthUserByRecvData(user, data, size))
     {
         this.CloseAndUpdateUserState(user);
     }
     else
     {
         this.OnAuthSuccess(user);
     }
     return(false);
 }
 private bool OnPacketRead(byte[] data, int size, RailID user)
 {
     if (!this._connectionStateMap.ContainsKey(user))
     {
         return(false);
     }
     NetSocialModule.ConnectionState connectionState = this._connectionStateMap[user];
     if (connectionState != NetSocialModule.ConnectionState.Authenticating)
     {
         return(connectionState == NetSocialModule.ConnectionState.Connected);
     }
     if (!this.TryAuthUserByRecvData(user, data, size))
     {
         WeGameHelper.WriteDebugString(" Auth Server Ticket Failed");
         this.Close(user);
     }
     else
     {
         WeGameHelper.WriteDebugString("OnRailAuthSessionTicket Auth Success..");
         this.OnAuthSuccess(user);
     }
     return(false);
 }