C# Класс GameJoltAPI.Session

This singleton safe-thread handles sessions. All functions are exposed for manual use, there's also a function for automated handling.

See: http://gamejolt.com/api/doc/game/sessions/ for further information.

@author Christian "HyperGod" Bosence

@version 0.1.0.0

Показать файл Открыть проект

Открытые методы

Метод Описание
changeStatus ( SessionStatus status ) : void

Changes the session to the one passed. Active by default. Won't update until next ping (at worst 60 seconds delay).

close ( ) : void

Closes the session. Call this when the game is closing, or you no longer want sessions.

Throws an API exception if unsuccesful.

open ( bool automated = true, int game_id = null, string username = null, string user_token = null ) : void

Opens the the session. Will auto-manage, if automated isn't overriden.

Throws an API exception if unsuccesful.

Don't need to set any parameters if you've set up Config.

ping ( ) : void

Do not use if automated. Pings the API, to indicate the session. Uses the stored status. changeStatus() to alter this.

Throws an API exception if unsuccesful.

Приватные методы

Метод Описание
Session ( ) : System
pingE ( object source, System.Timers.ElapsedEventArgs e ) : void

Calls ping, with event parameters as required by timer. Doesn't need to be exposed, thus different accessor.

Описание методов

changeStatus() публичный статический Метод

Changes the session to the one passed. Active by default. Won't update until next ping (at worst 60 seconds delay).

public static changeStatus ( SessionStatus status ) : void
status SessionStatus SessionStatus enum to indicate the status.
Результат void

close() публичный статический Метод

Closes the session. Call this when the game is closing, or you no longer want sessions.

Throws an API exception if unsuccesful.

public static close ( ) : void
Результат void

open() публичный статический Метод

Opens the the session. Will auto-manage, if automated isn't overriden.

Throws an API exception if unsuccesful.

Don't need to set any parameters if you've set up Config.

public static open ( bool automated = true, int game_id = null, string username = null, string user_token = null ) : void
automated bool Do you want Session to set up a timer thread to automate the pinging? Defaults to true.
game_id int ID of your Game. Only set if you haven't in config. Don't need to set parameter if you've set up Config.
username string Username of your User. Don't need to set parameter if you've set up Config.
user_token string User token of your User. Don't need to set parameter if you've set up Config.
Результат void

ping() публичный статический Метод

Do not use if automated. Pings the API, to indicate the session. Uses the stored status. changeStatus() to alter this.

Throws an API exception if unsuccesful.

public static ping ( ) : void
Результат void