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

파일 보기 프로젝트 열기: Bosence/GameJolt-C--API

공개 메소드들

메소드 설명
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