Hi,
I need to have some "global data" available for every player connected to the game (e.g. the bank interest rate).
Using Combu is it possible to store in database data trough the inventory functions but the data is related to a specific player and can be retrieved only if the player is connected.
There is a way to avoid to write a custom php file for this type of interactions?
Thank you for cooperation!!
best regards
Fabio
What kind of "global data"? Usually you want to use customData of the User class to store your data, it's attached to every User result handler. If you combine it with the user search webservice through customData fields you may reach your goal.
Anyway you could write your own webservices as well to even customize your experience, just take a look at the webservice code that you want to override and use it as base for your customizations. Then you have two options: create your own class inheriting from the Combu core classes (CombuManager, User etc) and overriding the methods you need, or create your own methods inside your scripts (I'd recommend to not modify directly the core classes, inherit and override is a clever and more elegant way to extend Combu).
PS: I'd also recommend to use the new Combu 2.0 instead of 1.x (in My Downloads on this website there's a link to the latest RC version).
FRANCESCO CROCETTI @ SKARED CREATIONS
In the game every player has a bank account, with an amount of money. The bank interest rate must be the same for all the players, so I need to save this number in the database and retrieve it for daily interest accreditation to every player. This is what I call "global data". I was searching a simple way to do this using Combu functionalities...
I understand your suggestion and will try to make it.
Also downloaded 2.0 RC9 and will try to use it in the project.
Thank you for your fast response!!!
Best regards
Fabio
Released R10 right now with these features and minor changes.
Oh I see what you mean. Well, I think that "Server Settings" would be a good feature to add and perfectly fits your need: we already have GetServerInfo that is automatically called at launch from CombuManager, so we can just add to CombuServerInfo class a Hashtable like any other customData around (the auto-loaded server info are accessible through serverInfo).
The "Server Settings" feature will be added to the next RC, you will be able to manage these settings from your admin console.
FRANCESCO CROCETTI @ SKARED CREATIONS
Oh very good!!! Thank you! I will download the RC10 and see it...
Good work!
Fabio
Hi,
I can't find in admin console how to setup serverinfo settings. There is a way to do these?
Thank you for help!!
Not for now, this feature request has been added to the next update wish-list. For now you can edit server.php (and CombuServerInfo class) and add your own variables.
FRANCESCO CROCETTI @ SKARED CREATIONS