Skip to content

Instantly share code, notes, and snippets.

View registerlogin.js
//Login URL:
//https://preview.gamesparks.net/callback/<yourAPIKey>/userLogin/<yourCredentialSecret>?username=<username>&password=<password>
//Register URL:
//https://preview.gamesparks.net/callback/<yourAPIKey>/register/<yourCredentialSecret>?username=<username>&password=<password>&displayName=<displayName>
//The login code:
var uPwd = Spark.getData().password;
View postScore.js
//URL
/*
https://preview.gamesparks.net/callback/<gameAPIKey>/postScore/<credentialSecret>?
score=<playerScore> -- Needs to always be called score but it could represent anything. Whatever is being counted by the event.
&password=<playerPassword>
&username=<playerUsername>
&eventname=<leaderboardEventName> -- The name of the event that is attached to the leaderboard.
View saveandload.js
//Get url: https://preview.gamesparks.net/callback/<apiKey>/savePlayerTable/<credential secret>?username=<username>&password=<user password>&tablename=<table name>
//Save url: https://preview.gamesparks.net/callback/<apiKey>/getPlayerTable/<credential secret>?username=<username>&password=<user password>&tablename=<table name>
//Get Code
var uPwd = Spark.getData().password;
var uName = Spark.getData().username;
var uTableName = Spark.getData().tablename;
View retrieveleaderboard.js
//url:
/*
https://preview.gamesparks.net/callback/<appKey>/retrieveLeaderboard/<credentialSecret>?
aroundme=true& -- Return scores above and below current user. Omit if you want the top of the leaderboard.
leaderboardname=<shotnameofleaderboard>& -- Name of the leaderboard.
entrycount=<number of entries>& -- How many entries to return. If aroundMe is included in the call this number will be the records returned above and below the user otherwise this will be the total number of records.
username=<player user name>& -- Username of player.
password=<player password> -- Password of player.
*/
@agramonte
agramonte / lua.json
Last active Oct 22, 2018 — forked from mika76/lua.json
Corona SDK snippers for VS Code
View lua.json
{
"gs.setLogger":{
"body": "gs.setLogger( ${1:listener} )",
"description": "Set Gamesparks logging listener.",
"prefix": "gs.setLogger"
},
"gs.setApiKey":{
"body": "gs.setApiKey( ${1:key} )",
"description": "Set Gamespark key.",
"prefix": "gs.setApiKey"
View gist:f6140dfb57c0db06084df84609c43883
local gameSparkKey = "<myKey>"
local gameSparkSecret = "<mySecret>"
local gameSparkPropertyName = "pageServerVersions"
local json = require( "json" )
local gs = require("plugin.gamesparks")
local G = {}
@agramonte
agramonte / main.lua-Corona
Created Dec 9, 2019
Example of making editable grid.
View main.lua-Corona
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
local composer = require( "composer" )
local json = require( "json" )
local scene = composer.newScene()
local widget = require "widget"
View js
// Version 3.0: Saving and retrieving a shared table.
// Version 2.1: Added header so that returned table gets encoded correctly.
// Version 2.0: Save and retrieve table
// Version 1.0: Login
// Change these parameters for your game
var returnFalseOnLock = true;
var requestType = Spark.getData().requestType;
var tableData = Spark.getData().params;
Spark.setScriptData("RESPONSE_HEADERS", {"content-type":"text/html; charset=utf-8"});
@agramonte
agramonte / json
Created Jan 26, 2021
solar2d - skadnetworkitems for ironsource (all lower case)
View json
SKAdNetworkItems = {
{ SKAdNetworkIdentifier = "su67r6k2v3.skadnetwork" },
{ SKAdNetworkIdentifier = "4dzt52r2t5.skadnetwork" },
{ SKAdNetworkIdentifier = "bvpn9ufa9b.skadnetwork" },
{ SKAdNetworkIdentifier = "488r3q3dtq.skadnetwork" },
{ SKAdNetworkIdentifier = "424m5254lk.skadnetwork" },
{ SKAdNetworkIdentifier = "v79kvwwj4g.skadnetwork" },
{ SKAdNetworkIdentifier = "22mmun2rn5.skadnetwork" },
{ SKAdNetworkIdentifier = "kbd757ywx3.skadnetwork" },
{ SKAdNetworkIdentifier = "zmvfpc5aq8.skadnetwork" },
View ironsourceSKAdNetwork.xml
<dict><key>SKAdNetworkIdentifier</key><string>"su67r6k2v3.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"4dzt52r2t5.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"bvpn9ufa9b.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"488r3q3dtq.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"424m5254lk.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"v79kvwwj4g.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"22mmun2rn5.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"kbd757ywx3.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"zmvfpc5aq8.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"wzmmz9fp6w.skadnetwork"</string></dict>