RMMV Can someone adjust this script for use with lootlocker?

Status
Not open for further replies.

BreakerZero

Veteran
Veteran
Joined
Jul 8, 2018
Messages
1,108
Reaction score
486
First Language
English (USA)
Primarily Uses
RMMV
Currently I'm working with GameJolt services for trophies in my main project through the plugin located here, however I was wondering if I could have it converted to support lootlocker. I'm needing it for a game jam as it is an integral part of the challenge to use the service for leaderboards and stuff.

Any takers? I'm listing for MV, but MZ is also requested (preferably in the same plugin).

EDIT: It's general REST API stuff, and proving to be tricky. However, the following is a short example of what I have from my own experiments:

JavaScript:
auth = function() {

fetch('https://api.lootlocker.io/game/v2/session/guest', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'game_key': '4a330796e1a088fd725234cb4f1fd984af866109',
        'game_version': '0.0.0.1',
        'development_mode': 'true'
    })
  });
};
postScore = function() {

fetch('https://api.lootlocker.io/game/leaderboards/xenaWarriors/submit', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        'score': 1000
    })
  });
};
getLeaderboard = function() {

return fetch('https://api.lootlocker.io/game/leaderboards/xenaWarriors/list?count=10');
}

EDIT 2: Forgot about the API reference guide. Here it is over this way.

EDIT 3: I ended up figuring it out. I'll repost with a proper plugin after the jam is done and I have a chance to change the format accordingly.
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,841
Reaction score
6,257
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

Dev be like: "I'll make the character goes amnesia so I could explain the world and the lore better and immersive to the players"
Whoever decided that the 5th area of Xenoblade 3 had to be THAT big and be explored in the manner it does needs to be shot. My OCD cannot leave a tiny shard of the map hidden and those controls can go right on and f*** themselves. -.-

/rant off
Raggon wrote on NoPatience's profile.
:kaohi:

Forum statistics

Threads
124,435
Messages
1,163,619
Members
163,246
Latest member
BagOfAnts
Top