| | |
| | | import com.aoyou.sdk.domain.PaymentCallbackInfo; |
| | | import com.aoyou.sdk.domain.PaymentErrorMsg; |
| | | import com.reyun.tracking.sdk.Tracking; |
| | | import com.squareup.okhttp.Callback; |
| | | import com.squareup.okhttp.OkHttpClient; |
| | | import com.squareup.okhttp.Request; |
| | | import com.squareup.okhttp.Response; |
| | | import com.ss.android.common.lib.EventUtils; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | String serverName, |
| | | JSONObject ext) |
| | | { |
| | | StringBuilder _stringBuilder = new StringBuilder(); |
| | | _stringBuilder.append("http://pub.game.2460web.com:11000/event_receiver?"). |
| | | append("ProductID=snxxz"). |
| | | append("&OperatorID=").append("yilegame"). |
| | | append("&RegionName=data"). |
| | | append("&RegionID=").append(serverID). |
| | | append("&EventID=1105"). |
| | | append("&Time=").append(UniversalUtil.getStringDate()). |
| | | append("&AccountID=").append(m_AccountID); |
| | | |
| | | LogUtil.i(TAG,"注册请求: " + _stringBuilder.toString()); |
| | | |
| | | OkHttpClient client = new OkHttpClient(); |
| | | Request request = new Request.Builder() |
| | | .url(_stringBuilder.toString()) |
| | | .build(); |
| | | client.newCall(request).enqueue(new Callback() { |
| | | @Override |
| | | public void onFailure(Request request, IOException e) |
| | | { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onResponse(Response response) throws IOException |
| | | { |
| | | if(response.isSuccessful()){ |
| | | String _code = response.body().string().trim(); |
| | | LogUtil.i(TAG,"注册返回 : " + _code); |
| | | if(_code.equals("1")) |
| | | { |
| | | Tracking.setRegisterWithAccountID(m_AccountID); |
| | | EventUtils.setRegister("mobile",true); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | EventUtils.setLogin("mobile",true); |
| | | Tracking.setLoginSuccessBusiness(m_AccountID); |
| | | |
| | | SDKManager.getInstance(activity).setRoleDate(activity, roleID, |
| | | roleName, roleLv, |
| | | serverID, serverName, |
| | | ext); |
| | | } |
| | | |
| | | public void SendRegisterEvent() |
| | | { |
| | | Tracking.setRegisterWithAccountID(m_AccountID); |
| | | EventUtils.setRegister("mobile",true); |
| | | } |
| | | |
| | | public void SendLoginEvent() |
| | | { |
| | | Tracking.setLoginSuccessBusiness(m_AccountID); |
| | | } |
| | | } |