Пример #1
0
 private void OnValidateAuthTicketResponse(Steamworks.SteamId SteamId, Steamworks.SteamId OwnerId, AuthResponse Status)
 {
     if (Auth_Steam.ValidateConnecting(SteamId, OwnerId, Status))
     {
         return;
     }
     Network.Connection str = Network.Net.sv.connections.FirstOrDefault <Network.Connection>((Network.Connection x) => x.userid == SteamId);
     if (str == null)
     {
         UnityEngine.Debug.LogWarning(string.Format("Steam gave us a {0} ticket response for unconnected id {1}", Status, SteamId));
         return;
     }
     if (Status == AuthResponse.OK)
     {
         UnityEngine.Debug.LogWarning(string.Format("Steam gave us a 'ok' ticket response for already connected id {0}", SteamId));
         return;
     }
     if (Status == AuthResponse.VACCheckTimedOut)
     {
         return;
     }
     str.authStatus = Status.ToString();
     Network.Net.sv.Kick(str, string.Concat("Steam: ", Status.ToString()));
 }
        public void OnAuthResponseMessage(NetworkConnection conn, AuthResponseMessage msg)
        {
            AuthResponse authResponse = (AuthResponse)msg.status;

            if (logger.LogEnabled())
            {
                logger.LogFormat(LogType.Log, "Authentication Response: {0}", authResponse.ToString());
            }
            if (authResponse == AuthResponse.OK)
            {
                // Invoke the event to complete a successful authentication
                OnClientAuthenticated.Invoke(conn);
            }
            else
            {
                conn.isAuthenticated = false;
                conn.Disconnect();
            }
        }
Пример #3
0
    public static bool ValidateConnecting(ulong steamid, ulong ownerSteamID, AuthResponse response)
    {
        Connection connection = waitingList.Find((Connection x) => x.userid == steamid);

        if (connection == null)
        {
            return(false);
        }
        connection.ownerid = ownerSteamID;
        if (ServerUsers.Is(ownerSteamID, ServerUsers.UserGroup.Banned) || ServerUsers.Is(steamid, ServerUsers.UserGroup.Banned))
        {
            connection.authStatus = "banned";
            return(true);
        }
        switch (response)
        {
        case AuthResponse.OK:
            connection.authStatus = "ok";
            return(true);

        case AuthResponse.VACBanned:
            connection.authStatus = "vacbanned";
            return(true);

        case AuthResponse.PublisherBanned:
            connection.authStatus = "gamebanned";
            return(true);

        case AuthResponse.TimedOut:
            connection.authStatus = "ok";
            return(true);

        default:
            connection.authStatus = response.ToString();
            return(true);
        }
    }
Пример #4
0
    public static bool ValidateConnecting(SteamId steamid, SteamId ownerSteamID, AuthResponse response)
    {
        Connection str = Auth_Steam.waitingList.Find((Connection x) => x.userid == steamid);

        if (str == null)
        {
            return(false);
        }
        str.ownerid = ownerSteamID;
        if (ServerUsers.Is(ownerSteamID, ServerUsers.UserGroup.Banned) || ServerUsers.Is(steamid, ServerUsers.UserGroup.Banned))
        {
            str.authStatus = "banned";
            return(true);
        }
        if (response == AuthResponse.OK)
        {
            str.authStatus = "ok";
            return(true);
        }
        if (response == AuthResponse.VACBanned)
        {
            str.authStatus = "vacbanned";
            return(true);
        }
        if (response == AuthResponse.PublisherIssuedBan)
        {
            str.authStatus = "gamebanned";
            return(true);
        }
        if (response == AuthResponse.VACCheckTimedOut)
        {
            str.authStatus = "ok";
            return(true);
        }
        str.authStatus = response.ToString();
        return(true);
    }
Пример #5
0
 private void IOnPlayerBanned(Connection connection, AuthResponse status)
 {
     // TODO: Get BasePlayer and pass instead of Connection
     Interface.CallHook("OnPlayerBanned", connection, status.ToString());
 }
Пример #6
0
 private void IOnPlayerBanned(Connection connection, AuthResponse status)
 {
     Interface.CallHook("OnPlayerBanned", connection, status.ToString());
 }