-
-
Notifications
You must be signed in to change notification settings - Fork 38
Self hosting: Admin tools
The server has a number of admin backend tools to help with development and/or administration. Any requests to these endpoints must be authenticated using the developer token as a bearer token.
Removed in version 4.0.106. (https://github.com/SapiensAnatis/Dawnshard/pull/1376)
The server has a GraphQL endpoint at /api/savefile/graphql which exposes admin functionality for querying/mutating player savefiles.
This is not an exhaustive list; the schema is auto-generated so to see all possible mutations/queries please use a GraphQL client such as Postman.
Add materials to a player's gift box
mutation {
givePresent(viewerId: 1717, entityType: Material, entityId: 201014002, entityQuantity: 5) {
presentId
}
}Get a player's tutorial_flag_list
query {
player(viewerId: 609) {
userData {
tutorialFlagList
}
}
}The REST endpoints GET /api/savefile/export/{viewerId} and POST /api/savefile/import/{viewerId} allow you to manually import / export saves without having to deal with the BaaS system.
The server offers the ability for you to log in as another user for the purpose of troubleshooting issues that prove difficult to reproduce.
This can be achieved via the website. First, set yourself up as an admin in the database. This must be done by manually connecting with a database client such as psql or PGAdmin -- there is no tool to achieve this yet for security reasons.
BEGIN;
UPDATE "Players" SET "IsAdmin" = true WHERE "ViewerId" = <your viewer id goes here>;
COMMIT;
Then on the website you will be able to see a user impersonation window:
From here you can configure the user you want to impersonate. Obviously, only one impersonation session can be active at a time. You can clear it to log in as yourself again.