Betonquest: Creating 'Profiles/Acccounts' (API Question)

Created on 27 Sep 2019  路  4Comments  路  Source: BetonQuest/BetonQuest

Help wanted!

Greetings, currently we have a profile/account system that allows players to have multiple profiles on their MC account on the server. (We save their current class, loc, inv, armor, potioneffects, money, etc) into a DB and depending on what profile/account they choose is what gets loaded for that play session.

I am hoping to use the API to do something similar with Beton otherwise they're going to have the same quest status across all of their profile/accounts.

What would be the best way to do this?
On a save method
#getPlayerData(string).getTags(); and #getPlayerData(string).getConversation(); etc and save it to my DB with the other data I already save?

When I load a players profile, #getPlayerData(string).purgePlayer(); then start to load the data into Beton from my DB with
#getPlayerData(string).addTag(tag);
#getPlayerData(string).addRawObjective(objectiveID, data);?

Thanks in advance for any tips/insights.

Duplicate Support Question

All 4 comments

This may possibly relate to #965.

This won't totally answer your question since I've not really dealt much yet with the code that deals with the players data but I'd suggest looking at how BQ saves a player when they log out and loads when they log in. This is because you'll need to then activate all the objectives again for example. This happens in JoinQuitListerner.java

Perhaps if this can be a bit more generic it may make switching profiles more easier.

I had a look at the code, and i am really sure, this is possible. But at the moment i am not really sure, which way is the best way to implement this.

At the moment i think the easiest way is, to manipulate the putPlayerData() and removePlayerData() Method in the BetonQuest class, so that diffrent player data is loaded. Maybe, it would be a nice idear, to implement the MultiProfile fearture direkt in BQ.

Duplicate #965

Quest profiles will propably be a native feature.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soliddanii picture soliddanii  路  5Comments

InsanityGamer picture InsanityGamer  路  7Comments

biffamc picture biffamc  路  6Comments

NotJustPizza picture NotJustPizza  路  3Comments

PsychoLynx picture PsychoLynx  路  3Comments