
Originally Posted by
C453
ehrm......
Here's a quick fix... not the best but it works.
Database.cs -
Code:
public bool isWhitelisted(Account acc)
{
var cmd = CreateQuery();
cmd.CommandText = "SELECT whitelisted FROM accounts WHERE id=@id";
cmd.Parameters.AddWithValue("@id", acc.AccountId);
object scalar = cmd.ExecuteScalar();
if (scalar.ToString() == "1")
{
return true;
}
else
{
return true;
}
}
@
Trapped will lol at this
looooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooool.
No, the real code to be changed is that (snippet from Register method in Database.cs):
Code:
public object Register(string uuid, string password, bool isGuest)
{
var cmd = CreateQuery();
cmd.CommandText = "SELECT COUNT(id) FROM accounts WHERE uuid=@uuid;";
cmd.Parameters.AddWithValue("@uuid", uuid);
if (cmd.ExecuteNonQuery() == 0) return null;
cmd = CreateQuery();
cmd.CommandText = "INSERT INTO accounts(uuid, password, name, admin, namechosen, verified, guild, guildRank, vaultCount, maxCharSlot, regTime, guest, whitelisted, banned) VALUES(@uuid, SHA1(@password), @NaMe, 0, 0, 0, 0, 0, 1, 1, @regtime, @guest, 0, 0);";
The bold values are the whitelist ones. Change the second one to 1 to have every account whitelisted by default (or delete both if you want to modify that from the Database table settings).