View Single Post
Author Message
kalash1k
Member
Join Date: Nov 2008
Old 09-09-2011 , 22:03   How to hook "password failed"
Reply With Quote #1

Hello.
I have a great idea. So here is a small description:

The server has sv_password "123". Then client is connecting to the server from his server menu (like Favorites). Then there is appears prompt window to enter a pass. And then if client type wrong password like "111" server kicks the client with log message like:
Quote:
0.0.0.0:27005: password failed
How can I hook this event? I need exactly the moment when the server is checking the password client sent.

What I need it for? I want to check client typed password with my own database (like forum DB or something) and NOT with sv_password. But I need sv_password cvar for that prompt window appearing when client tries to connect to the server.

I.e. here is an algorithm:
  1. Client connects and he dont know real sv_password.
  2. Password window appears.
  3. Client types his FORUM USER password (or site user pw etc.). NOT a sv_password.
  4. Server check his password NOT with sv_password but with my own database.
  5. If client password == DB password then continue.
  6. Else kick with message like "Wrong password. Register here http://google.com".
I tried to use client_connect(), tried to hook forwards (like FM_ClientConnect), events, messages. So there is no effect. These hooks works after the server has checked the client password.

I searched about it in Orpheu threads. Like here. But I'm not so pro scripter and dont know how to use it.
I found the thread How to hook "Bad Rcon" command?. But I dont know how to use it for sv_password.

Please help.

Thanks. And sry for my english.
kalash1k is offline