LitDev Extension API
LDNetwork
Network or web methods.
DownloadFile | GetGameData | HighScore |
LAN | Ping | SetGameData |
SetSSL |
DownloadFile(localFile,remoteFile)
Similar To Network.DownloadFile, except the download file is input and handles larger files better.
localFile The local file name to save the downloaded file.
remoteFile The remote network file.
returns The size of the file in bytes or -1 for failue.
GetGameData(game)
Download some data (previously saved) for a game.
game The game name (a unique case sensitive name for each game or version is required).
returns The stored data on success.
HighScore(game,user,score)
Upload a potential high score to the web.
All values are case sensitive and the score should be an integer number.
game The game name (a unique name for each game or version is required).
user The user name.
score The score.
returns An array with the current high score user name and their score.
LAN(timeout)
Get a list of the devices and their addresses connected to your local area network (LAN, home network, 192.168.1.xx).
timeout A timeout in ms, e.g. 1000.
returns An array of IP address and device names with ping time, indexed by IP address.
Ping(IP,timeout)
Ping an IP address and return the roundtrip time.
IP The IP address (or url) to ping.
timeout A timeout in ms, e.g. 1000.
returns The roundtrip time on success (ms) or -1 on failure
SetGameData(game,data)
Upload some data for a game.
game The game name (a unique case sensitive name for each game or version is required).
data The data to store, may be an array.
returns The stored data on success.
SetSSL()
Set SSL security for network operations downoading files.
LoadImage and DownloadFile both use this method internally for special cases.
Use this call before using various network operations that do not require LoadImage or DownloadFile.