minor comments & fixes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6151 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2011-03-28 20:07:29 +00:00
parent b7ddd337ce
commit f3e4d1b73b
4 changed files with 23 additions and 26 deletions
+13 -9
View File
@@ -619,15 +619,19 @@ void genauthkey(const char *secret)
void saveauthkeys()
{
stream *f = openfile("config/auth.cfg", "w");
if(!f) { conoutf("failed to open config/auth.cfg for writing"); return; }
loopv(authkeys)
{
authkey *a = authkeys[i];
f->printf("authkey \"%s\" \"%s\" \"%s\"\n", a->name, a->key, a->desc);
}
conoutf("saved authkeys to config/auth.cfg");
delete f;
if(authkeys.length())
{
stream *f = openfile("config/auth.cfg", "w");
if(!f) { conoutf("failed to open config/auth.cfg for writing"); return; }
loopv(authkeys)
{
authkey *a = authkeys[i];
f->printf("authkey \"%s\" \"%s\" \"%s\"\n", a->name, a->key, a->desc);
}
conoutf("saved authkeys to config/auth.cfg");
delete f;
}
else conoutf("you need to use 'addauthkey USER KEY DESC' first; one DESC 'public', one DESC empty(=private)");
}
bool tryauth(const char *desc)