
Originally Posted by
Xn4rz0
Bugs :
When we want to buy a group it disconnects us, when one wants to wear it too
Good !
- - - Updated - - -
Bugs:
@
jamal7
- Floor plan save.
- Ignore button.
- Public rooms.
- Forums for groups
- Add in the choice of staffs
- Crystals animations
- Freeze game
- Battle Banzai game
- Single Bundle page.
- coatings d/c
- Room Ads bug.
- From both bots and animals come in the apartment when we go.
- TV youtube bug a little, we can not add / view videos
- Talents achievements
- Voucher code in catalog
- Guide tool

Originally Posted by
Rush Retros
Bug Report ( Voucher codes doesnt work)
Simple voucher fix:
Replace the whole
PHP Code:
internal void RedeemVoucher() {
in Rooms.cs with
PHP Code:
internal void RedeemVoucher() {
// Voucher name
string ticket = this.Request.PopFixedString();
// Init
bool isValid = false;
DataRow dRow;
bool used = true;
// Get voucher from database
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT * FROM vouchers WHERE voucher = @vo LIMIT 1");
dbClient.addParameter("vo", ticket);
dRow = dbClient.getRow();
}
// Check if used
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT * FROM voucher_uses WHERE voucher = @vo AND user_id = @uid LIMIT 1");
dbClient.addParameter("vo", ticket);
dbClient.addParameter("uid", this.Session.GetHabbo().Id);
used = (dbClient.getRow() == null ? false : true);
}
// Check if it is valid
if (dRow != null && (int)dRow["cur_uses"] < (int)dRow["max_uses"] && !used)
{
// Set voucher valid
isValid = true;
// Voucher valid, add 1 to cur_uses
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("UPDATE vouchers SET cur_uses = cur_uses+1 WHERE voucher = @vou LIMIT 1");
dbClient.addParameter("vou", ticket);
dbClient.runQuery();
}
// Voucher valid, add user to voucher_uses
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("INSERT INTO voucher_uses VALUES (@vo, @uid)");
dbClient.addParameter("vo", ticket);
dbClient.addParameter("uid", this.Session.GetHabbo().Id);
dbClient.runQuery();
}
// Update Credits
this.Session.GetHabbo().Credits += (int)dRow["credits"];
this.Session.GetHabbo().UpdateCreditsBalance();
// Update Duckets/Pixels
this.Session.GetHabbo().ActivityPoints += (int)dRow["duckets"];
this.Session.GetHabbo().NotifyNewPixels((int)dRow["duckets"]);
// Update Belcredits(callcredits)/Snowflakes/Activity Points
this.Session.GetHabbo().BelCredits += (int)dRow["activity_points"];
this.Session.GetHabbo().UpdateActivityPointsBalance();
// Update to database
this.Session.GetHabbo().RunDBUpdate(SilverwaveEnvironment.GetDatabaseManager().getQueryreactor());
}
// Notify the user
this.Session.GetHabbo().NotifyVoucher(isValid, "", "");
}
And run this sql
PHP Code:
-- ----------------------------
-- Table structure for voucher_uses
-- ----------------------------
DROP TABLE IF EXISTS `voucher_uses`;
CREATE TABLE `voucher_uses` (
`voucher` varchar(255) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for vouchers
-- ----------------------------
DROP TABLE IF EXISTS `vouchers`;
CREATE TABLE `vouchers` (
`voucher` varchar(255) NOT NULL,
`credits` int(11) NOT NULL DEFAULT '100',
`duckets` int(11) NOT NULL,
`activity_points` int(11) NOT NULL,
`max_uses` int(11) NOT NULL DEFAULT '1',
`cur_uses` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`voucher`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;