by 12345hassan » November 4th, 2018, 5:16 am
by Henrik » November 8th, 2018, 7:04 am
by 12345hassan » November 9th, 2018, 5:39 pm
by Henrik » November 11th, 2018, 1:27 am
by 12345hassan » November 15th, 2018, 4:12 pm
by Henrik » November 16th, 2018, 11:48 pm
by 12345hassan » November 17th, 2018, 7:57 am
by 12345hassan » November 17th, 2018, 9:27 am
by 12345hassan » November 24th, 2018, 7:24 am
12345hassan wrote:Is there a way to give the top 3 prizes?
The top 3 players on the index I want to give them prizes from another table like
Loads top 3 players
Loads the other tables objects of those three
Save their with prizes
Then it delete all objects.
by Henrik » November 25th, 2018, 2:48 am
LoadRange("the table", "the new index", null, null, null, 3, ...)
by 12345hassan » November 25th, 2018, 7:03 am
Henrik wrote:If you have a BigDB Table that contains scores per user, and you want to load the top 3, you need a descending index on the table over the score property, and then you can load the top 3 something like this:
- Code: Select all
LoadRange("the table", "the new index", null, null, null, 3, ...)
That gets you the three first objects in the index, and since it's descending and over the score, the first three should be the top 3, which is what you wanted.
by Henrik » November 26th, 2018, 10:26 pm
by 12345hassan » December 27th, 2018, 5:22 pm
by 12345hassan » January 5th, 2019, 9:26 am
12345hassan wrote:Can you tell me how to use LoadKeys, I cannot use it plus the databaseobject used for the top3 loaded (result) gives
Cannot convert from PlayerIO.GameLibrary.DatabaseObject[] to string[]
by Henrik » January 13th, 2019, 8:51 pm
by 12345hassan » January 15th, 2019, 10:08 am
Henrik wrote:You can't pass in the three databaseobjects of the top three users into LoadKeys, you need to grab whatever string property in those three databaseobjects represent the connectuserid, and then make an array of those three strings, and pass that into LoadKeys.
I don't know exactly what your BigDB tables look like, so it's hard to help you further than this. Which tables in which game are we talking about? I can take a better look if I just know which game and tables.
by Henrik » February 12th, 2019, 4:51 am
LoadRange("STTableOfActive", "active", null, null, null, 3, delegate(DatabaseObject[] topThreeActive) {
//Now you have the top three objects in Active table.
//Extract the keys of those three, and put in a string array.
var keys = new string[]{ topThreeActive[0].Key, topThreeActive[1].Key, topThreeActive[2].Key };
//Load the objects in the Items table that has those keys
LoadKeys("STTableOfItems", keys, delegate(DatabaseObject[] topThreeItems) {
//Change some properties of these three objects
topThreeItems[0].Set("items.lolface", 1);
topThreeItems[1].Set("items.elfhat", 1);
topThreeItems[2].Set("items.tennisracket", 1);
//Don't forget to save the objects...
}, delegate(PlayerIOError error) {
//Something went wrong loading from Items table
});
}, delegate(PlayerIOError error) {
//Something went wrong loading from Active table
});
by 12345hassan » February 13th, 2019, 9:53 am