in-game AUTH

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5637 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2010-08-16 11:12:48 +00:00
parent e61d9f6c45
commit 928eed4de1
11 changed files with 380 additions and 52 deletions
+22 -3
View File
@@ -631,13 +631,32 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
break;
}
case SV_SCOPE: // FIXME remove in the next protocol change
// for AUTH:
case SV_AUTHREQ:
{
getint(p);
getint(p);
extern int autoauth;
getstring(text, p);
if(autoauth && text[0] && tryauth(text)) conoutf("server requested authkey \"%s\"", text);
break;
}
case SV_AUTHCHAL:
{
getstring(text, p);
authkey *a = findauthkey(text);
uint id = (uint)getint(p);
getstring(text, p);
if(a && a->lastauth && lastmillis - a->lastauth < 60*1000)
{
vector<char> buf;
answerchallenge(a->key, text, buf);
//conoutf("answering %u, challenge %s with %s", id, text, buf.getbuf());
addmsg(SV_AUTHANS, "rsis", a->desc, id, buf.getbuf());
}
break;
}
// :for AUTH
case SV_GIBDAMAGE:
case SV_DAMAGE:
{