#region Room entry badges
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users SET room_visits = room_visits + 1 WHERE id = '" + User.userID + "'");
{
int rooms_entered;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
rooms_entered = dbClient.getInt("SELECT room_visits FROM users WHERE id = '" + User.userID + "'");
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("INSERT INTO users_badges (userid,badge,badgeid) VALUES ('" + User.userID + "','ACH_RoomEntry1','ACH_RoomEntry1')");
User.sendData("BKYou have entered your first room, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 5)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry2' AND badgeid = 'ACH_RoomEntry2' WHERE badge = 'ACH_RoomEntry1' AND badgeid = 'ACH_RoomEntry1' AND userid = '" + User.userID + "'");
sendData("BK5 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 15)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry3' AND badgeid = 'ACH_RoomEntry3' WHERE badge = 'ACH_RoomEntry2' AND badgeid = 'ACH_RoomEntry2' AND userid = '" + User.userID + "'");
User.sendData("BK15 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 25)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry4' AND badgeid = 'ACH_RoomEntry4' WHERE badge = 'ACH_RoomEntry3' AND badgeid = 'ACH_RoomEntry3' AND userid = '" + User.userID + "'");
User.sendData("BK25 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 40)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry5' AND badgeid = 'ACH_RoomEntry5' WHERE badge = 'ACH_RoomEntry4' AND badgeid = 'ACH_RoomEntry4' AND userid = '" + User.userID + "'");
User.sendData("BK40 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 60)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry6' AND badgeid = 'ACH_RoomEntry6' WHERE badge = 'ACH_RoomEntry5' AND badgeid = 'ACH_RoomEntry5' AND userid = '" + User.userID + "'");
User.sendData("BK60 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 90)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry7' AND badgeid = 'ACH_RoomEntry7' WHERE badge = 'ACH_RoomEntry6' AND badgeid = 'ACH_RoomEntry6' AND userid = '" + User.userID + "'");
User.sendData("BK90 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 100)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry8' AND badgeid = 'ACH_RoomEntry8' WHERE badge = 'ACH_RoomEntry7' AND badgeid = 'ACH_RoomEntry7' AND userid = '" + User.userID + "'");
User.sendData("BK100 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 150)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry9' AND badgeid = 'ACH_RoomEntry9' WHERE badge = 'ACH_RoomEntry8' AND badgeid = 'ACH_RoomEntry8' AND userid = '" + User.userID + "'");
User.sendData("BKWow! 150 rooms entered, you get a new badge!");
User.refreshBadges();
}
if (rooms_entered == 200)
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
dbClient.runQuery("UPDATE users_badges SET badge = 'ACH_RoomEntry10' AND badgeid = 'ACH_RoomEntry10' WHERE badge = 'ACH_RoomEntry9' AND badgeid = 'ACH_RoomEntry9' AND userid = '" + User.userID + "'");
User.sendData("BKWow! 200 rooms entered, you get a new badge!");
User.refreshBadges();
}
}
}
#endregion