/// <summary> /// 反馈信息接口 /// </summary> /// <param name="data">用户反馈的数据</param> public void PostFeedback(int type, string msg, System.Action <bool> callback = null) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = GlobalConfig.GetInstance().CSURLV + "Feedback"; url += "?account=" + loginInfo.AccName; url += "&game_mark=" + globalConfig.GameMark; url += "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); url += "&device_mark=dm" + globalConfig.DeviceMark; url += "&provider=" + globalConfig.SDKName; url += "&server_id=" + loginInfo.ServerInfo.ServerId; url += "&role_id=" + loginInfo.RId; url += "&role_name=" + WWW.EscapeURL(LocalPlayerManager.Instance.LocalActorAttribute.Name, System.Text.Encoding.UTF8); url += "&lv=" + LocalPlayerManager.Instance.LocalActorAttribute.Level; url += "&type=" + type; url += "&title=" + WWW.EscapeURL(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_18"), System.Text.Encoding.UTF8); url += "&msg=" + WWW.EscapeURL(msg, System.Text.Encoding.UTF8); //url = System.Uri.EscapeUriString(url); mPostFeedbackCallback = callback; MainGame.HttpRequest.GET(url, OnFeedback, null); }
/// <summary> /// 获取指定服务器的状态,如果可以进入则直接进入 /// </summary> public void CheckServerStateAndEnter(ServerInfo serverInfo, GetServerStateFinishedDelegate getServerStateFinishedCallback = null, bool enter = true) { if (serverInfo == null) { return; } GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; #if UNITY_IPHONE string sign = string.Format("server_id={0}&game_mark={1}&device_mark={2}&show_marked={3}&account={4}", serverInfo.ServerId, GlobalConfig.Instance.GameMark, globalConfig.DeviceMark, globalConfig.ServerType, loginInfo.AccName); Debug.Log(string.Format("controlServer_oriSign_SrvSt2 = {0}", sign)); sign = WWW.EscapeURL(Utils.AES.Encode(sign, Const.CS_URL_KEY, Const.CS_URL_IV)); var url = string.Format("{0}SrvSt2?sign={1}", GlobalConfig.Instance.CSURLVEX, sign); #else string url = globalConfig.CSURLV + "GetServerState?server_id=" + serverInfo.ServerId + "&game_mark=" + GlobalConfig.Instance.GameMark + "&device_mark=" + globalConfig.DeviceMark + "&show_marked=" + globalConfig.ServerType + "&account=" + loginInfo.AccName; #endif MainGame.HttpRequest.GET(url, OnGetServerStateFinished, serverInfo); mGetServerStateFinishedCallback = getServerStateFinishedCallback; mEnterWhenGetServerStateFinished = enter; }
/// <summary> /// 账号登陆日志记录(已经选服登陆请求) /// </summary> /// <param name="serverId">Server identifier.</param> /// <param name="serverType">Server type.</param> public void PostAccountLoginLogS(int serverId, EServerState serverType) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = GlobalConfig.GetInstance().LogURLV + "AccountLoginLogS?account=" + loginInfo.AccName; url += "&server_id=" + serverId; url += "&server_type=" + (int)serverType; url += "&show_marked=" + globalConfig.ServerType; url += "&provider=" + globalConfig.SDKName; url += "&device_mark=" + globalConfig.DeviceMark; url += "&os=" + globalConfig.PlatformName; url += "&os_ver=" + bridge.getOSVersion(); url += "&mobile=" + bridge.getPhoneModel(); url += "&net=" + bridge.getNetType(); url += "&imei=" + bridge.getPhoneIMEI(); url += "&mac=" + bridge.getPhoneMAC(); url += "&imsi=" + bridge.getPhoneIMSI(); url += "&game_mark=" + globalConfig.GameMark; url += "&sub_chn=" + globalConfig.SubChannel; MainGame.HttpRequest.GET(url, null, null); }
/// <summary> /// 获取最近登录服务器列表 /// </summary> public void GetLatelyLoginServerInfo(GetLatelyLoginServerListFinishedDelegate finishCallback) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = globalConfig.CSURLV + "GetLatelyLoginServerInfo?show_marked=" + globalConfig.ServerType + "&game_mark=" + GlobalConfig.Instance.GameMark + "&account=" + globalConfig.LoginInfo.AccName + "&device_mark=" + globalConfig.DeviceMark; MainGame.HttpRequest.GET(url, OnGetLatelyLoginServerInfoFinished, null); mGetLatelyLoginServerListFinishedCallback = finishCallback; }
/// <summary> /// 角色日志接口 /// </summary> public void PostRoleInfo() { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getDBOSManager().getBridge(); if (loginInfo == null || loginInfo.ServerInfo == null) { return; } string url = GlobalConfig.GetInstance().LogURLV + "RoleInfo"; url += "?account=" + loginInfo.AccName; url += "&provider=" + globalConfig.SDKName; url += "&device_mark=" + globalConfig.DeviceMark; url += "&server_id=" + loginInfo.ServerInfo.ServerId; url += "&os=" + globalConfig.PlatformName; url += "&level=" + loginInfo.Level; url += "&role_id=" + loginInfo.RId; url += "&role_name=" + WWW.EscapeURL(loginInfo.Name); url += "&icon_id=" + loginInfo.Job; url += "&job=" + loginInfo.Job; url += "&game_mark=" + globalConfig.GameMark; url += "&mobile=" + bridge.getPhoneModel(); url += "&net=" + bridge.getNetType(); url += "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); // 获取不到IMEI(例如玩家不给权限),就用玩家唯一id代替 string imei = bridge.getPhoneIMEI(); if (string.IsNullOrEmpty(imei) == false) { url += "&imei=" + imei; } else { url += "&imei=" + loginInfo.RId; } url += "&roleInfo=" + "transfer_lv:" + TransferHelper.GetTransferLevel(); // 自定义角色数据,例:roleInfo=tran_lv:213#icon_id:3#gander:man url += "&xg_device_id=" + globalConfig.XgDeviceId; url += "&vip=" + VipHelper.GetVipValidLevel(); url += "&app_id=" + globalConfig.AppId; url += "&access_id=" + bridge.getXgAccessId(); MainGame.HttpRequest.GET(url, OnPostRoleInfoFinished, null); }
/// <summary> /// 获取全部大区列表 /// </summary> public void GetAllRegion(GetAllRegionFinishedDelegate finishCallback) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = globalConfig.CSURLV + "GetAllRegion?show_marked=" + globalConfig.ServerType + "&account=" + loginInfo.AccName + "&game_mark=" + GlobalConfig.Instance.GameMark + "&device_mark=" + globalConfig.DeviceMark + "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); MainGame.HttpRequest.GET(url, OnGetAllRegionFinished, null); mGetAllRegionFinishedCallback = finishCallback; }
/// <summary> /// 获取服务器信息 /// </summary> public void GetServerData(GetServerDataFinishedDelegate finishCallback) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = globalConfig.CSURLV + "GetServerData?account=" + loginInfo.AccName + "&show_marked=" + globalConfig.ServerType + "&game_mark=" + globalConfig.GameMark + "&imei=" + bridge.getPhoneIMEI() + "&device_mark=" + globalConfig.DeviceMark; MainGame.HttpRequest.GET(url, OnGetServerDataFinished, null); mGetServerDataFinishedCallback = finishCallback; }
/// <summary> /// 反馈系统获取配置面板信息 /// </summary> public void GetFeedbackInfo(System.Action <LuaTable> callback = null) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; string url = GlobalConfig.GetInstance().CSURLV + "Feedback/GetConfig"; url += "?role_id=" + loginInfo.RId; url += "&game_mark=" + globalConfig.GameMark; url += "&os=" + globalConfig.PlatformName; url += "&provider=" + globalConfig.SDKName; mGetFeedbackCallback = callback; MainGame.HttpRequest.GET(url, OnGetFeedbackInfo, null); }
/// <summary> /// 礼包兑换码接口 /// </summary> /// <param name="code">Code.</param> public void PostGetPack(string code, System.Action <bool> callback = null) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = GlobalConfig.GetInstance().CSURLV + "GetPack"; url += "?game_mark=" + globalConfig.GameMark; url += "&code=" + code; url += "&server_id=" + loginInfo.ServerInfo.ServerId; url += "&provider=" + globalConfig.SDKName; url += "&account=" + loginInfo.AccName; url += "&role_id=" + loginInfo.RId; url += "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); mPostGetPackFinishedCallback = callback; MainGame.HttpRequest.GET(url, OnGetPackFinished, null); }
/// <summary> /// 获取推荐服务器列表 /// </summary> public void GetAllRecommServer(GetAllRecommServerFinishedDelegate finishCallback) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = globalConfig.CSURLV + "GetAllRecommServer?account=" + globalConfig.LoginInfo.AccName + "&show_marked=" + globalConfig.ServerType + "&game_mark=" + GlobalConfig.Instance.GameMark + "&imei=" + bridge.getPhoneIMEI() + "&device_mark=" + globalConfig.DeviceMark; if (Const.Region == RegionType.SEASIA) { url += "&lang=" + Const.LanguageName(); } MainGame.HttpRequest.GET(url, OnGetAllRecommServerFinished, null); mGetAllRecommServerFinishedCallback = finishCallback; }
//void OnLevelup(CEventBaseArgs args) //{ // PostRoleInfo(); //} /// <summary> /// 客户端启动日志采集 /// </summary> public void PostStartClientLog() { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = GlobalConfig.GetInstance().LogURLV + "StartClientLog?provider=" + globalConfig.SDKName; url += "&device_mark=" + globalConfig.DeviceMark; url += "&os=" + globalConfig.PlatformName; url += "&os_ver=" + bridge.getOSVersion(); url += "&mobile=" + bridge.getPhoneModel(); url += "&net=" + bridge.getNetType(); url += "&imei=" + bridge.getPhoneIMEI(); url += "&mac=" + bridge.getPhoneMAC(); url += "&imsi=" + bridge.getPhoneIMSI(); url += "&use_time=" + ((int)Time.time).ToString(); url += "&game_mark=" + globalConfig.GameMark; MainGame.HttpRequest.GET(url, null, null); }
/// <summary> /// 获取账号最后登录服务器 /// </summary> public void GetLastLoginServerInfo(GetLastLoginServerInfoFinishedDelegate finishCallback) { GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; #if UNITY_IPHONE string url = globalConfig.CSURLVEX + "GetLastLoginServerInfo?show_marked=" + globalConfig.ServerType + "&account=" + loginInfo.AccName + "&game_mark=" + GlobalConfig.Instance.GameMark + "&device_mark=" + globalConfig.DeviceMark + "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); #else string url = globalConfig.CSURLV + "GetLastLoginServerInfo?show_marked=" + globalConfig.ServerType + "&account=" + loginInfo.AccName + "&game_mark=" + GlobalConfig.Instance.GameMark + "&device_mark=" + globalConfig.DeviceMark + "&ticket=" + WWW.EscapeURL(loginInfo.Ticket); #endif MainGame.HttpRequest.GET(url, OnGetLastLoginServerInfoFinished, null); mGetLastLoginServerInfoFinishedCallback = finishCallback; }
/// <summary> /// 玩家登录轨迹 /// </summary> public void PostPlayerFollowRecord(PlayerFollowRecordSceneId sceneId, string desc = "", bool isEnterGame = true) { if (sceneId == PlayerFollowRecordSceneId.EnterFirstScene) { // TestinExternalLog DBOSManager.getOSBridge().log2OSCmd("TestinExternalLog", mLogContent); // TestinExternalLog var logContent = string.Format(mLogFmt, 3 - QualitySetting.GraphicLevel); DBOSManager.getOSBridge().log2OSCmd("TestinExternalLog", logContent); // 云梯第一次进入场景 ControlServerLogHelper.Instance.PostCloudLadderEventAction(CloudLadderMarkEnum.enter_game); } FieldInfo fi = sceneId.GetType().GetField(sceneId.ToString()); DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); string scene = (attributes.Length > 0) ? attributes[0].Description : sceneId.ToString(); LanguageType languageType = Const.Language; fi = languageType.GetType().GetField(languageType.ToString()); attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); string language = (attributes.Length > 0) ? attributes[0].Description : languageType.ToString(); //GameDebug.LogError("PostPlayerFollowRecord scene: " + scene); GlobalConfig globalConfig = GlobalConfig.GetInstance(); GlobalConfig.LoginInfoStruct loginInfo = globalConfig.LoginInfo; IBridge bridge = DBOSManager.getOSBridge(); string url = globalConfig.CommonURL + "playerFollowRecord"; url += "?gameMark=" + globalConfig.GameMark; if (string.IsNullOrEmpty(loginInfo.AccName) == true) { url += "&account=none"; } else { url += "&account=" + loginInfo.AccName; } if (loginInfo.ServerInfo != null) { url += "&server_id=" + loginInfo.ServerInfo.ServerId; } url += "&role_id=" + loginInfo.RId; url += "&role_name=" + WWW.EscapeURL(loginInfo.Name); url += "&level=" + loginInfo.Level; if (isEnterGame == true) { url += "&vip=" + VipHelper.GetVipValidLevel(); } else { url += "&vip=0"; } url += "&provider=" + globalConfig.SDKName; url += "&scene=" + WWW.EscapeURL(scene); url += "&msg=" + WWW.EscapeURL(desc); url += "&position=0"; url += "&os=" + globalConfig.PlatformName; url += "&osVer=" + bridge.getOSVersion(); url += "&brand=" + WWW.EscapeURL(bridge.getBrand()); url += "&model=" + WWW.EscapeURL(bridge.getPhoneModel()); url += "&job=" + loginInfo.Job; url += "&net=" + bridge.getNetType(); if (isEnterGame == true) { if (Game.Instance.ServerTime > 0) { url += "&time=" + Game.Instance.ServerTime; } else { url += "&time=" + System.Convert.ToUInt32(xc.Maths.Util.ConvertDateTimeToTimestamp(System.DateTime.Now));; } } else { url += "&time=0"; } url += "&device_mark=" + globalConfig.DeviceMark; url += "&start_time=" + globalConfig.StartTimeStamp; #if UNITY_IPHONE url += "&imei=" + bridge.GetPhoneIDFA(); #else url += "&imei=" + bridge.getPhoneIMEI(); #endif url += "&mac=" + bridge.getPhoneMAC(); url += "&imsi=" + bridge.getPhoneIMSI(); url += "&app_version=" + bridge.getAppVersion(); url += "&chn_id=" + bridge.getSdkID(); url += "&carrier=" + WWW.EscapeURL(bridge.getOperator()); url += "&jbk=" + bridge.isRoot(); url += "&did=" + bridge.getSDKDeviceID(); url += "&tz=" + WWW.EscapeURL(bridge.getTimeZone()); url += "&lang=" + language; url += "&width=" + bridge.getWindowWidth(); url += "&height=" + bridge.getWindowHeigh(); url += "&apil=" + bridge.getAPILevel(); url += "&idfa=" + bridge.GetPhoneIDFA(); url += "&idfv=" + bridge.getPhoneIDFV(); url += "&ip=" + WWW.EscapeURL(bridge.getLocalIpAddress()); url += "&wifi=" + WWW.EscapeURL(bridge.getWfName()); url += "&factory=" + WWW.EscapeURL(bridge.getManufacturer()); url += "&game_version=" + VersionInfoManager.Instance.GameVersion; url += "&appId=" + bridge.getAppID(); url += "&sdkv=" + bridge.getSDKVersionName(); HttpRequest.Instance.GET(url, null, null); GameDebug.Log("PostPlayerFollowRecord: " + scene); }