public static void Register(String login, String password) { string str = "register " + "login="******";password=" + password; Response response = DBSocketRequest.Send(str); if (response is ErrorResponse) { Exception exception = ((ErrorResponse)response).ThrowException(); throw exception; } else { RegistractionServerResult result = JsonConvert.DeserializeObject <RegistractionServerResult>(response.ToString()); } }
public static void RequestCoins(Server.TokenAndId tai, int amount) { string str = "add_coins " + "id=" + tai.id + ";token=" + tai.token + ";amount=" + amount; Response response = DBSocketRequest.Send(str); if (response is ErrorResponse) { Exception exception = ((ErrorResponse)response).ThrowException(); throw exception; } else { RegistractionServerResult result = JsonConvert.DeserializeObject <RegistractionServerResult>(response.ToString()); } }