public void onBandResult(string jsonResult) { JsonParser jsonParser = new JsonParser(new StringReader(jsonResult), true); JsonObject jsonObject = jsonParser.ParseObject(); RequestCode reqCode = (RequestCode)((JsonNumber)jsonObject[BandGameObject.REQUEST_CODE]).Value; int num = -1; NXBandResult result = null; if (jsonObject.ContainsKey(BandGameObject.RESULT)) { JsonObject jsonObject2 = (JsonObject)jsonObject[BandGameObject.RESULT]; if (jsonObject2.ContainsKey("result_data")) { result = NXBandResult.makeFromJson(reqCode, (JsonObject)jsonObject2["result_data"]); } if (jsonObject2.ContainsKey("result_code")) { num = (int)((JsonNumber)((JsonObject)jsonObject[BandGameObject.RESULT])["result_code"]).Value; } } if (num < 0) { num = (int)((JsonNumber)jsonObject[BandGameObject.RESULT_CODE]).Value; } if (this._resultHandler != null) { BandResultHandler resultHandler = this._resultHandler; this._resultHandler = null; resultHandler.onResult(reqCode, num, result); } }
public void getAccessToken(BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call getUserKey()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); this.callJavaMethod(RequestCode.REQUEST_ACCESS_TOKEN, new object[0]); }
public void login(BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call login()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); this.callJavaMethod(RequestCode.REQUEST_LOGIN, new object[0]); }
public void getProfile(string userKey, BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call getProfile()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); this.callJavaMethod(RequestCode.REQUEST_PROFILE, new object[] { userKey }); }
public void listBands(BandListOption option, BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call listBands()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); string text = null; if (option != null) { text = option.getJsonString(); } this.callJavaMethod(RequestCode.REQUEST_LIST_BAND, new object[] { text }); }
public void writePost(string bandKey, string body, string imageUrl, string subTitle, string subText, BandMessageCustomUrl customUrl, BandResultHandler resultHandler) { this.writePost(bandKey, body, imageUrl, subTitle, subText, customUrl.getCustomUrlDictionary(), resultHandler); }
public void writePost(string bandKey, string body, string imageUrl, string subTitle, string subText, Dictionary <string, string> customUrl, BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call writePost()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); this.callJavaMethod(RequestCode.REQUEST_WRITE_POST, new object[] { this.postJson(bandKey, body, imageUrl, subTitle, subText, customUrl) }); }
public void sendMessage(string receiverKey, string message, string title, string imageUrl, BandMessageCustomUrl customUrl, BandResultHandler resultHandler) { this.sendMessage(receiverKey, message, title, imageUrl, customUrl.getCustomUrlDictionary(), resultHandler); }
public void sendMessage(string receiverKey, string message, string title, string imageUrl, Dictionary <string, string> customUrl, BandResultHandler resultHandler) { if (!this.isInitilazed) { throw new InvalidOperationException("You must call init() before call sendMessage()"); } this._gameObject.SendMessage(BandManager.SET_HANDLER, resultHandler); this.callJavaMethod(RequestCode.REQUEST_SEND_MESSAGE, new object[] { this.messageJson(receiverKey, message, title, imageUrl, customUrl) }); }
public void setHandler(BandResultHandler resultHandler) { this._resultHandler = resultHandler; }