public Test_Infos() { string cred = System.IO.File.ReadAllText(@"..\..\..\creds.txt"); deezer = new PrivateAPI(cred); deezer.InitializeAPI().GetAwaiter().GetResult(); }
public Bitso(string key, string secret, bool production = false) { BITSO_KEY = key; BITSO_SECRET = secret; BITSO_API_URL = production ? "https://api.bitso.com" : "https://api-dev.bitso.com"; BITSO_VERSION_PREFIX = "/api/v3/"; PrivateAPI = new PrivateAPI(this); PublicAPI = new PublicAPI(this); AccountCreationAPI = new AccountCreationAPI(this); }
private void InitClient(tk.TcpClient client) { if (privateAPI) // private API client server { PrivateAPI privateAPIHandler = GameObject.FindObjectOfType <PrivateAPI>(); if (privateAPIHandler != null) { if (_server.debug) { Debug.Log("init private API handler."); } privateAPIHandler.Init(client.gameObject.GetComponent <tk.JsonTcpClient>()); } } else // normal client server { if (spawnCarswClients) // we are on in a track scene { CarSpawner spawner = GameObject.FindObjectOfType <CarSpawner>(); if (spawner != null) { if (_server.debug) { Debug.Log("spawning car."); } spawner.Spawn(client.gameObject.GetComponent <tk.JsonTcpClient>(), false); } } else //we are in the menu { tk.TcpMenuHandler handler = GameObject.FindObjectOfType <TcpMenuHandler>(); if (handler != null) { if (_server.debug) { Debug.Log("init menu handler."); } handler.Init(client.gameObject.GetComponent <tk.JsonTcpClient>()); } } } }
void Start() { privateAPI = GameObject.FindObjectOfType <PrivateAPI>(); }