Skip to content

NewgroundsIO.results.Medal.getList

PsychoGoldfishNG edited this page Aug 20, 2022 · 3 revisions

NGIO

NGIO singleton wrapper for NewgroundsIO Library.

Kind: global class

ngiO.ngioCore : NewgroundsIO.Core

A reference to the NewgroundsIO.Core instance created in Init().

Kind: instance property of NGIO

NGIO.STATUS_INITIALIZED : string

Kind: static property of NGIO

NGIO.STATUS_CHECKING_LOCAL_VERSION : string

Kind: static property of NGIO

NGIO.STATUS_LOCAL_VERSION_CHECKED : string

Kind: static property of NGIO

NGIO.STATUS_PRELOADING_ITEMS : string

Kind: static property of NGIO

NGIO.STATUS_ITEMS_PRELOADED : string

Kind: static property of NGIO

NGIO.STATUS_READY : string

Kind: static property of NGIO

NGIO.STATUS_SESSION_UNINITIALIZED : string

Kind: static property of NGIO

NGIO.STATUS_WAITING_FOR_SERVER : string

Kind: static property of NGIO

NGIO.STATUS_LOGIN_REQUIRED : string

Kind: static property of NGIO

NGIO.STATUS_WAITING_FOR_USER : string

Kind: static property of NGIO

NGIO.STATUS_LOGIN_CANCELLED : string

Kind: static property of NGIO

NGIO.STATUS_LOGIN_SUCCESSFUL : string

Kind: static property of NGIO

NGIO.STATUS_LOGIN_FAILED : string

Kind: static property of NGIO

NGIO.STATUS_USER_LOGGED_OUT : string

Kind: static property of NGIO

NGIO.STATUS_SERVER_UNAVAILABLE : string

Kind: static property of NGIO

NGIO.STATUS_EXCEEDED_MAX_ATTEMPTS : string

Kind: static property of NGIO

NGIO.PERIOD_TODAY : string

Kind: static property of NGIO

NGIO.PERIOD_CURRENT_WEEK : string

Kind: static property of NGIO

NGIO.PERIOD_CURRENT_MONTH : string

Kind: static property of NGIO

NGIO.PERIOD_CURRENT_YEAR : string

Kind: static property of NGIO

NGIO.PERIOD_ALL_TIME : string

Kind: static property of NGIO

NGIO.PERIODS : Array.<string>

Kind: static property of NGIO

NGIO.medals : Array.<NewgroundsIO.objects.Medal>

An array of preloaded medals

Kind: static property of NGIO

NGIO.scoreBoards : Array.<NewgroundsIO.objects.ScoreBoard>

An array of preloaded scoreBoards

Kind: static property of NGIO

NGIO.saveSlots : Array.<NewgroundsIO.objects.SaveSlot>

An array of preloaded saveSlots

Kind: static property of NGIO

NGIO.lastExecution : Date

The last time a component or queue was executed

Kind: static property of NGIO

NGIO.lastConnectionStatus : string

Contains the last connection status. Value will be one of the STATUS_XXXXX constants.

Kind: static property of NGIO

NGIO.sessionError : NewgroundsIO.objects.Error

Will be null unless there was an error in our session.

Kind: static property of NGIO

NGIO.legalHost : boolean

Will be set to false if the local copy of the game is being hosted illegally.

Kind: static property of NGIO

NGIO.isDeprecated : boolean

Will be set to true if this is an out-of-date copy of the game.

Kind: static property of NGIO

NGIO.newestVersion : boolean

This is the version number(string) of the newest available copy of the game.

Kind: static property of NGIO

NGIO.loginPageOpen : boolean

Will be true if the user opened the login page via OpenLoginPage().

Kind: static property of NGIO

NGIO.gatewayVersion : string

The current version of the Newgrounds.io gateway.

Kind: static property of NGIO

NGIO.lastMedalUnlocked : NewgroundsIO.objects.Medal

Stores the last medal that was unlocked.

Kind: static property of NGIO

NGIO.lastBoardPosted : NewgroundsIO.objects.ScoreBoard

Stores the last scoreboard that was posted to.

Kind: static property of NGIO

NGIO.lastScorePosted : NewgroundsIO.objects.Score

Stores the last score that was posted to.

Kind: static property of NGIO

NGIO.lastGetScoresResult : NewgroundsIO.results.ScoreBoard.getScores

Stores the last scores that were loaded.

Kind: static property of NGIO

NGIO.lastSaveSlotLoaded : NewgroundsIO.objects.SaveSlot

Stores the last saveSlot that had data loaded.

Kind: static property of NGIO

NGIO.lastSaveSlotSaved : NewgroundsIO.objects.SaveSlot

Stores the last saveSlot that had data saved.

Kind: static property of NGIO

NGIO.lastDateTime : string

Stores the last DateTime that was loaded from the API.

Kind: static property of NGIO

NGIO.lastLoggedEvent : string

Stores the last event that was logged.

Kind: static property of NGIO

NGIO.lastTimeStamp : number

Stores the last unix timestamp that was loaded API.

Kind: static property of NGIO

NGIO.lastPingSuccess : boolean

Stores wether the last server ping succeeded.

Kind: static property of NGIO

NGIO.isInitialized : boolean

Will be true if we've called Init().

Kind: static property of NGIO

NGIO.session : NewgroundsIO.objects.Session

Contains all information about the current user session.

Kind: static property of NGIO

NGIO.user : NewgroundsIO.objects.User

Contains user information if the user is logged in. Otherwise null.

Kind: static property of NGIO

NGIO.hasSession : boolean

Returns true if we currently have a valid session ID.

Kind: static property of NGIO

NGIO.hasUser : boolean

Returns true if we currently have a valid session ID.

Kind: static property of NGIO

NGIO.isReady : boolean

Will be true if we've finished logging in and preloading data.

Kind: static property of NGIO

NGIO.version : string

The version number passed in Init()'s options

Kind: static property of NGIO

NGIO.debugMode : boolean

Will be tue if using debugMode via Init()

Kind: static property of NGIO

NGIO.init(appID, aesKey, options)

Initializes the NGIO wrapper. You must call this BEFORE using any other methods!

Kind: static method of NGIO

Param Type Description
appID string The App ID from your Newgrounds Project's "API Tools" page.
aesKey string The AES-128 encryption key from your Newgrounds Project's "API Tools" page.
options object An object of options to set up the API wrapper.
options.debugMode boolean Set to true to run in debug mode.
options.version string A string in "X.X.X" format indicating the current version of this game.
options.checkHostLicense boolean Set to true to check if the site hosting your game has been blocked.
options.preloadMedals boolean Set to true to preload medals (will show if the player has any unlocked, and get their current medal score).
options.preloadeScoreBoards boolean Set to true to preload Score Board information.
options.preloadeSaveSlots boolean Set to true to preload Save Slot information.
options.autoLogNewView boolean Set to true to automatcally log a new view to your stats.

NGIO.skipLogin()

Call this if you want to skip logging the user in.

Kind: static method of NGIO

NGIO.openLoginPage()

Opens the Newgrounds login page in a new browser tab.

Kind: static method of NGIO

NGIO.cancelLogin()

If the user opened the NG login page, you can call this to cancel the login attempt.

Kind: static method of NGIO

NGIO.logOut()

Logs the current use out of the game (locally and on the server) and resets the connection status.

Kind: static method of NGIO

NGIO.loadAuthorUrl()

Loads "Your Website URL", as defined on your App Settings page, in a new browser tab.

Kind: static method of NGIO

NGIO.loadOfficialUrl()

Loads our "Official Version URL", as defined on your App Settings page, in a new browser tab.

Kind: static method of NGIO

NGIO.loadMoreGames()

Loads the Games page on Newgrounds in a new browser tab.

Kind: static method of NGIO

NGIO.loadNewgrounds()

Loads the Newgrounds frontpage in a new browser tab.

Kind: static method of NGIO

NGIO.loadReferral(referralName)

Loads the Newgrounds frontpage in a new browser tab.

Kind: static method of NGIO

Param Type Description
referralName string The name of your custom referral.

NGIO.getMedal(medalID)

Gets a preloaded Medal object.

Kind: static method of NGIO

Param Type Description
medalID number The ID of the medal

NGIO.unlockMedal(medalID, callback, thisArg)

Attempts to unlock a medal and returns the medal to an optional callback function when complete.

Kind: static method of NGIO

Param Type Description
medalID number The id of the medal you are unlocking.
callback unlockMedalCallback A function to run when the medal has unlocked.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.getScoreBoard(scoreBoardID)

Gets a preloaded ScoreBoard object.

Kind: static method of NGIO

Param Type Description
scoreBoardID number The ID of the score board

NGIO.postScore(boardID, value, tag, callback, thisArg)

Posts a score and returns the score and scoreboard to an optional callback function when complete.

Kind: static method of NGIO

Param Type Description
boardID number The id of the scoreboard you are posting to.
value number The integer value of your score.
tag string An optional tag to attach to the score (use null for no tag).
callback postScoreCallback A function to run when the score has posted.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.getScores(boardID, period, tag, social, callback, thisArg)

Gets the best scores for a board and returns the board, score list, period, tag and social bool to an optional callback.

Kind: static method of NGIO

Param Type Description
boardID number The id of the scoreboard you loading from.
period string The time period to get scores from. Will match one of the PERIOD_XXXX constants.
tag string An optional tag to filter results by (use null for no tag).
social boolean Set to true to only get scores from the user's friends.
callback getScoresCallback A function to run when the scores have been loaded.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.getSaveSlot(saveSlotID)

Gets a preloaded SaveSlot object. (Use getSaveSlotData to get actual save file)

Kind: static method of NGIO

Param Type Description
saveSlotID number The desired slot number

NGIO.getTotalSaveSlots()

Gets the number of non-empty save slots.

Kind: static method of NGIO

NGIO.getSaveSlotData(slotID, callback, thisArg)

Loads the actual save file from a save slot, and passes the string result to a callback function.

Kind: static method of NGIO

Param Type Description
slotID number The slot number to load from
callback getSaveSlotDataCallback A function to run when the file has been loaded
thisArg object An optional object to use as 'this' in your callback function.

NGIO.setSaveSlotData(slotID, data, callback, thisArg)

Loads the actual save file from a save slot and returns the save slot to an optional callback function when complete.

Kind: static method of NGIO

Param Type Description
slotID number The slot number to save to.
data string The (serialized) data you want to save.
callback setSaveSlotDataCallback An optional function to run when the file finished saving.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.logEvent(eventName, callback, thisArg)

Logs a custom event and returns the eventName to an optional callback function when complete.

Kind: static method of NGIO

Param Type Description
eventName string The name of the event to log.
callback logEventCallback A function to run when the event has logged.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.getDateTime(callback, thisArg)

Loads the current DateTime from the server and returns it to an optional callback function.

Kind: static method of NGIO

Param Type Description
callback getDateTimeCallback A function to run when the datetime has loaded.
thisArg object An optional object to use as 'this' in your callback function.

NGIO.keepSessionAlive()

Keeps your ssessions from expiring. Is called automatically. This will only hit the server once every 30 seconds, no matter how often you call it.

Kind: static method of NGIO

NGIO.getConnectionStatus(callback, thisArg)

Intended to be called from your game loop, this does an entire process of things based on your Init() options:

  • Checks if the hosting site has a legal copy of this game
  • Checks for a newer version of the game
  • Makes sure you have a user session
  • Checks if the current user is logged in
  • Preloads Medals, Saveslots, etc
  • Logs a new view to your stats

Whenever a new operation begins or ends, the current state will be passed to your callback function.

Kind: static method of NGIO

Param Type Description
callback getConnectionStatusCallback A function to be called when there's a change of status. Will match one of the STATUS_XXXX constants.
thisArg object An optional object to use as 'this' in your callback function.
Clone this wiki locally