private void GE_XY_PAY_MSG(SG.GameEvent ge, SG.EventParameter parameter) { MsgData_WC_RechargeRet msg = parameter.msgParameter as MsgData_WC_RechargeRet; Debug.Log("GE_XY_PAY_MSG " + msg.m_szOrderID + ":" + msg.m_szProductName); Debug.Log("TrackingPay: " + data["amount"] + " : " + data["itemId"] + " : " + data["itemName"] + " : " + data["strPayOrder"]); XYSDK.Instance.TrackingPay(data["amount"], "1", data["itemId"], data["itemName"], data["strPayOrder"]); }
private void GE_LOGIN_MSG(SG.GameEvent ge, SG.EventParameter parameter) { MsgData_sLogin data = parameter.msgParameter as MsgData_sLogin; if (0 == data.ResultCode || -1 == data.ResultCode) { SGSDK.instance.SetUseInfo(SG.Account.Instance.AccountId, ""); } }
public static bool IsEventMsgNull(this SG.EventParameter msg) { if (msg == null) { return(true); } if (msg.msgParameter == null) { return(true); } return(false); }
private void OnDownLoadError() { System.Action callBack = delegate() { for (int i = 0; i < mDownLoadErrorVersionDataConfig.Count; i++) { mNewVersionDataConfig.Add(mDownLoadErrorVersionDataConfig[i]); } mDownLoadErrorVersionDataConfig.Clear(); DownLoadAsset(); }; if (mDownloadType == DownLoadType.FIRST_PHASE) { SG.EventParameter ep = SG.EventParameter.Get(20001); ep.objParameter = callBack; SG.CoreEntry.gEventMgr.TriggerEvent(SG.GameEvent.GE_DOWNLOAD_ASSET, ep); } else if (mDownloadType == DownLoadType.BACKGROUND_PHASE) { callBack(); } }
/// <summary> /// 服务器充值订单回复 /// </summary> /// <param name="ge"></param> /// <param name="parameter"></param> private void GE_DYB_RECHARGE_MSG(SG.GameEvent ge, SG.EventParameter parameter) { MsgData_sGetRechargeorder_DYB data = parameter.msgParameter as MsgData_sGetRechargeorder_DYB; Debug.Log("订单号 : " + data.data.ToString()); Debug.Log("大小 : " + data.dataSize.ToString()); Debug.Log("ID : " + data.ItemID.ToString()); string jsonData = data.data.ToArray().BytesToString(); Debug.Log("xy rechargeData: " + jsonData); JsonData json = JsonMapper.ToObject(jsonData); var tmp = json["orderNo"]; if (tmp.IsString) { sdkPayOrderId = (string)tmp; } else { sdkPayOrderId = ""; } tmp = json["extension"]; if (tmp.IsObject || tmp.IsArray) { sdkPayExtension = tmp.ToJson(); } else { sdkPayExtension = (string)tmp; } Debug.Log("sdkPayOrderId :" + sdkPayOrderId + " sdkPayExtension:" + sdkPayExtension + " itemID:" + data.ItemID); int configid = data.ItemID; CallBackPay(configid); }
/// <summary> /// 服务器充值订单回复 /// </summary> /// <param name="ge"></param> /// <param name="parameter"></param> private void GE_SQW_RECHARGE_MSG_FUN(SG.GameEvent ge, SG.EventParameter parameter) { Debug.Log("GE_SQW_RECHARGE_MSG_FUN : "); MsgData_sGetRechargeorder_SQW data = parameter.msgParameter as MsgData_sGetRechargeorder_SQW; Debug.Log("订单号 : " + data.data.ToString()); Debug.Log("大小 : " + data.dataSize.ToString()); Debug.Log("ID : " + data.ItemID.ToString()); string jsonData = data.data.ToArray().BytesToString(); Debug.Log("xy rechargeData: " + jsonData); JsonData json = JsonMapper.ToObject(jsonData); var tmp = json["order_no"]; if (tmp.IsString) { sdkPayOrderId = (string)tmp; } else { sdkPayOrderId = ""; } tmp = json["ext"]; if (tmp.IsObject || tmp.IsArray) { sdkPayExtension = tmp.ToJson(); } else { sdkPayExtension = (string)tmp; } tmp = json["sign"]; if (tmp.IsString) { sdkSign = (string)tmp; } else { sdkSign = ""; } tmp = json["flag"]; if (tmp.IsString) { sdkFlag = (string)tmp; } else { sdkFlag = ""; } tmp = json["time"]; if (tmp.IsString) { sdkTime = (string)tmp; } else { sdkTime = ""; } tmp = json["userid"]; if (tmp.IsString) { userID = (string)tmp; } else { userID = ""; } Debug.Log("sdkPayOrderId :" + sdkPayOrderId + "time :" + sdkTime + "sdkSign :" + sdkSign + " sdkPayExtension:" + sdkPayExtension + " itemID:" + data.ItemID); int configid = data.ItemID; CallBackPay(configid); }