Voucher Update Problem Plus Emulator

NapsterSwe

New Member
Feb 11, 2019
14
3
I have a huge problem with my retro. If I add a voucher in my database I need to use :update vouchers before we can use that code.
Is there any way to make it update automatically when a new voucher has been added to the database?

Thanks in advance!

You must be registered for see images attach
 

Hypothesis

Programmer
Jan 6, 2019
524
361
I have a huge problem with my retro. If I add a voucher in my database I need to use :update vouchers before we can use that code.
Is there any way to make it update automatically when a new voucher has been added to the database?

Thanks in advance!

You must be registered for see images attach
C#:
case "vouchers":
                    {
                        if (!Session.GetHabbo().GetPermissions().HasCommand("command_update_vouchers"))
                        {
                            Session.SendWhisper("Oops, you do not have the 'command_update_vouchers' permission.");
                            break;
                        }

                        PlusEnvironment.GetGame().GetCatalog().GetVoucherManager().Init();
                        Session.SendWhisper("Catalogue voucher cache successfully updated.");
                        break;
                    }
Add this to UpdateCommand.cs
Add command_update_vouchers to permissions_commands
DONE.
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
It's not possible in the aspect of adding it into the database directly. You have 2 other choices :

Create a command that will add a voucher such as :addvoucher CODE123 100 0 0 (100 credits, 0 pixels, 0 diamonds) and update the vouchers after adding

Or

Update the vouchers every 5 minutes or so with one of the existing game loops. (Bad idea unless you're constantly adding them)
 

NapsterSwe

New Member
Feb 11, 2019
14
3
@JayCustom the thing is, I was going to code an automatically SMS-system for the codes but that dosen't work if the emulator not checking for new added codes when someone has bought a product.

@Bjork how can I make it possible? Never used the RCON before.
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
@JayCustom the thing is, I was going to code an automatically SMS-system for the codes but that dosen't work if the emulator not checking for new added codes when someone has bought a product.

@Bjork how can I make it possible? Never used the RCON before.
Your server is somehow getting the information that they bought something right? So where-ever your server is getting the information you can call to the emulator to update it. So in this case, what @Bjork suggested may work. Check your emulator to see if you use RCon or if you use MUS commands
 

Users who are viewing this thread

Top