using LitJson; using UnityEngine; using UnityEngine.UI; using UnityEngine.Events; using System; using System.IO; using System.Net; using System.Xml; using System.Text; using System.Linq; using System.Net.Mail; using System.Collections; using System.Collections.Generic; using Random = UnityEngine.Random; public class MailItemLabel { public static string Title = "Title"; public static string Icon1 = "Icon1"; public static string Icon2 = "Icon2"; public static string Icon3 = "Icon3"; } public class MyCredentials : ICredentialsByHost { public NetworkCredential NetworkCredential; public NetworkCredential GetCredential(string host, int port, string authType) { return NetworkCredential.GetCredential(new Uri("http://" + host + ":" + port), authType); } public MyCredentials(string username, string password) { NetworkCredential = new NetworkCredential(username, password); } } public enum CommentType { Garden = 0, } public class HttpManager : Regist { public class MailReward { public string ID; public string Key; public string Value; public MailReward(string id, string key, string value) { ID = id; Key = key; Value = value; } } #region Config public static bool IsConnect { get { if (isConnect) { return true; } else { return TutorialManager.ConnectExempt; } } set { isConnect = value; } } public static bool isConnect; public static bool BuyPackLimitFlag { get { return buyPackLimitFlag; } set { buyPackLimitFlag = value; foreach (var kv in Manager.SkillDictionary) { if (kv.Value is Pack) { ((Pack) kv.Value).SetActive(); } } } } public static bool buyPackLimitFlag; public static int MaxReconnectAmt = 4; public static int ReconnectCounter; public static float ReconnectTime = 2f; public static float ReconnectTimeTimer; public static int PraiseAmt; public static bool IsRankDataReady; public static List RankDatas; public static int AnnounceIndex = -1; public static bool IsAnnounceReady; public static string AnnounceContent; public static Sprite AnnounceSpite; public static int ReplayVersion; public static bool Inited; public static bool FirstTimeConnectFlag = true; public static string ID = PlayerConfigLabel.DefaultID; public static string SerialNumber = PlayerConfigLabel.DefaultSerialNumber; public static string ReportIssueContent; public static JsonData LoginCallbackData; public static DateTime CurrentDateTime = DateTime.Now; public static string MailXmlStr; public static List MailRewardList = new List(); public static string BaseURL = "https://garden.dashgame.com/index.php/home"; public static string NewBaseURL = "https://garden.dashgame.com/index.php/newhome"; public static string NicknameURL = NewBaseURL + "/user/nickname"; public static string RankURL = NewBaseURL + "/user/look"; public static string PraiseURL= NewBaseURL + "/praise/click"; public static string TargetURL= NewBaseURL + "/praise/target"; public static string AddCommentURL= NewBaseURL + "/comment/comment"; public static string GetCommentURL= NewBaseURL + "/comment/index"; public static string IndexURL= NewBaseURL + "/index/index"; public static string GetProductIDURL= NewBaseURL + "/pay/pay"; public static string LoginURL= NewBaseURL + "/user/login"; public static string SaveURL= NewBaseURL + "/user/save"; public static string OtherURL= NewBaseURL + "/user/other"; public static string DownloadURL= NewBaseURL + "/user/load"; public static string RandomURL= NewBaseURL + "/user/rand"; public static string ThanksGiftInfoURL= NewBaseURL + "/index/gift"; public static string ReportMailAddress= "bug@dashgame.com"; #endregion public void Awake() { } public void Update() { if (!Manager.Inited && !Inited) { ReconnectTimeTimer += Time.deltaTime; if (ReconnectTimeTimer >= ReconnectTime) { ReconnectTimeTimer = 0; ReconnectCounter++; if (ReconnectCounter > MaxReconnectAmt) { Inited = true; Manager.FirstTimeLoginCallback(new JsonData()); } else { Login(Manager.FirstTimeLoginCallback); GetAlipayFlag(); } } } } public override bool InitAtOnce() { if (base.InitAtOnce()) { return true; } enabled = true; return false; } public override void FirstInit() { ReplayVersion = ConfigManager.GetIntFormConfig(PlayerConfigLabel.ReplayVersion); } public static void SetNickName(string nickname, Action succeedCallback, Action failCallback) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", SerialNumber); urlData.Add("n", nickname); URLRequest.CreateStrURLRequest ( true, NicknameURL, urlData, data => { if (data == "{\"error\":0}") { succeedCallback.Invoke(); } else if (data.Contains("Could not resolve host")) { failCallback.Invoke(Language.GetStr(LanguageLabel.UI__Fg_Lab3)); } else { failCallback.Invoke(Language.GetStr(LanguageLabel.UI__T_RepeatName)); } }, URLRequest.Method.POST ); } public static void GetRankData() { URLRequestData urlData = new URLRequestData(); URLRequest.CreateStrURLRequest ( false, RankURL, urlData, data => { string str = "{\"l\":" + data.Substring(1) + "}"; JsonData jsondata; try { jsondata = JsonMapper.ToObject(str); } catch (Exception) { jsondata = new JsonData(); jsondata["error"] = 0; } GetRankDataCallback(jsondata); } ); } public static void GetRankDataCallback(JsonData jsonData) { if (jsonData.Inst_Object.ContainsKey("l")) { RankDatas = new List(); for (int i = 0; i < jsonData["l"].Count; i++) { RankDatas.Add(jsonData["l"][i]); } IsRankDataReady = true; SocialManager.InitRankPanel(); } } public static void GetAnnounceData() { GetUrlAddress ( data => { URLRequestData urlData = new URLRequestData(); URLRequest.CreateStrURLRequest ( true, data["l"][3]["val"].ToString(), urlData, notificationXml => { GetAnnounceDataCallback(notificationXml); } ); } ); } public static void GetAnnounceDataCallback(string xml) { XmlNode rootNode; XmlDocument document = new XmlDocument(); try { document.LoadXml(xml); rootNode = document.SelectSingleNode("announce"); AnnounceIndex = int.Parse(rootNode.SelectSingleNode("version").InnerText); XmlNodeList nodeList = rootNode.SelectNodes(ConfigLabel.ChildNode); List urlList = new List(); for (int i = 0; i < nodeList.Count; i++) { DecodeAnnounceData(nodeList[i], urlList); } Auxiliary.Instance.StartCoroutine(PullAnnounceSprite(urlList, PullAnnounceSpriteCallback)); } catch (Exception e) { Debug.LogWarning(e); } } public static void DecodeAnnounceData(XmlNode node, List urlList) { XmlNodeList nodeList = node.SelectNodes("title"); for (int i = 0; i < nodeList.Count; i++) { AnnounceManager.AddContent(false, nodeList[i].Attributes[0].Value, nodeList[i].InnerText, TextAnchor.MiddleLeft); } AnnounceManager.AddContent(false, "null", node.SelectSingleNode("date").InnerText, TextAnchor.MiddleLeft); nodeList = node.SelectSingleNode("content").ChildNodes; for (int i = 0; i < nodeList.Count; i++) { if (nodeList[i].Name == "text") { AnnounceManager.AddContent(false, nodeList[i].Attributes[0].Value, nodeList[i].InnerText, TextAnchor.MiddleLeft); } else if (nodeList[i].Name == "image") { urlList.UniqueAdd(nodeList[i].InnerText); AnnounceManager.AddContent(true, "null", $"<({Path.GetFileNameWithoutExtension(nodeList[i].InnerText)})>", TextAnchor.MiddleCenter); } } AnnounceManager.AddContent(false, "null", "", TextAnchor.MiddleLeft); } public static IEnumerator PullAnnounceSprite(List urlList, Action> callback) { List wwwList = new List(); for (int i = 0; i < urlList.Count; i++) { wwwList.Add(new WWW(urlList[i])); } for (int i = 0; i < wwwList.Count; i++) { yield return wwwList[i]; } callback(wwwList); } public static void PullAnnounceSpriteCallback(List wwwList) { List textureList = new List(); List spriteInfoList = new List(); for (int i = 0; i < wwwList.Count; i++) { textureList.Add(wwwList[i].texture); SpriteInfo spriteInfo = new SpriteInfo(); spriteInfo.Name = Path.GetFileNameWithoutExtension(wwwList[i].url); spriteInfoList.Add(spriteInfo); } Texture2D atlas = new Texture2D(2048, 2048); Rect[] rects = atlas.PackTextures(textureList.ToArray(), 1); Sprite sprite = Sprite.Create(atlas, new Rect(0, 0, atlas.width, atlas.height), new Vector2(0.5f, 0.5f)); for (int i = 0; i < spriteInfoList.Count; i++) { spriteInfoList[i].Width = textureList[i].width; spriteInfoList[i].Height = textureList[i].height; spriteInfoList[i].UvList = new List() { new Vector2(rects[i].xMin, rects[i].yMax), new Vector2(rects[i].xMax, rects[i].yMax), new Vector2(rects[i].xMax, rects[i].yMin), new Vector2(rects[i].xMin, rects[i].yMin), }; SpriteAsset.SpriteInfoDic.Add(spriteInfoList[i].Name, spriteInfoList[i]); } AnnounceSpite = sprite; IsAnnounceReady = true; if (Initializer.Inited) { ResourceManager.Get(ObjectLabel.C_Notify).TweenForCG(); } } public static void Praise(string sendID, string receiveID) { if (receiveID == null) { return; } URLRequestData urlData = new URLRequestData(); urlData.Add("u", sendID); urlData.Add("t", receiveID); URLRequest.CreateStrURLRequest(true, PraiseURL, urlData, (data)=> {}, URLRequest.Method.POST); } public static void CheckIsPraised(string userID, string targetID, Action callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", userID); urlData.Add("t", targetID); URLRequest.CreateURLRequest(true, TargetURL, urlData, data => callback(data), URLRequest.Method.POST); } public static void AddComment(string sendID, string receiveID, string content, CommentType type) { if (string.IsNullOrEmpty(sendID) || string.IsNullOrEmpty(receiveID)) { return; } if (sendID.ToLower() == PlayerConfigLabel.DefaultID.ToLower() || receiveID.ToLower() == PlayerConfigLabel.DefaultID.ToLower()) { return; } URLRequestData urlData = new URLRequestData(); urlData.Add("c", sendID); urlData.Add("u", receiveID); urlData.Add("i", content); urlData.Add("t", type.GetHashCode()); URLRequest.CreateStrURLRequest ( true, AddCommentURL, urlData, data => { if (data == "{\"error\":0}") { Bubble.Show(Language.GetStr(LanguageLabel.UI__Q_CommentDone)); SocialManager.UpdateCommentPage(false); } else { Bubble.Show(Language.GetStr(LanguageLabel.UI__Q_CommentFail)); } }, URLRequest.Method.POST ); } public static void GetComment(string id, string page, CommentType type, Action callback) { JsonData defaultData = new JsonData(); defaultData["error"] = 0; if (string.IsNullOrEmpty(id)) { callback.Invoke(defaultData); return; } if (id.ToLower() == PlayerConfigLabel.DefaultID.ToLower()) { callback.Invoke(defaultData); return; } URLRequestData urlData = new URLRequestData(); urlData.Add("u", id); urlData.Add("p", page); urlData.Add("t", type.GetHashCode()); URLRequest.CreateURLRequest(true, GetCommentURL, urlData, data => { callback(data);}, URLRequest.Method.POST); } public static void GetUrlAddress(Action callback) { URLRequestData urlData = new URLRequestData(); URLRequest.CreateURLRequest ( true, IndexURL, urlData, data => { if (data.Inst_Object.ContainsKey("error")) { if (ConfigManager.configDocument != null) { if (Application.platform == RuntimePlatform.Android) { BuyPackLimitFlag = true; } else if (Application.platform == RuntimePlatform.IPhonePlayer) { BuyPackLimitFlag = ConfigManager.GetBoolFormConfig(PlayerConfigLabel.PackLock); } } } else { callback(data); } } ); } public static void GetMailAwardData() { //MailXml = "" + // "" + // "4" + // "2017-08-18 12:12:12" + // "2017-09-1 11:30:12" + // "" + // "1000" + // "10" + // "" + // "" + // "90arbl" + // "" + // "" + // "" + // "3" + // "2017-08-21 12:12:12" + // "2017-09-01 18:12:12" + // "" + // "10000" + // "100" + // "" + // "" + // "90arbl" + // "" + // "" + // ""; GetUrlAddress ( data => { URLRequestData urlData = new URLRequestData(); URLRequest.CreateStrURLRequest ( true, data["l"][1]["val"].ToJson().Trim('"'), urlData, mailXml => { MailXmlStr = mailXml; } ); } ); } public static void GetAllMailReward() { for (int i = 0; i < MailRewardList.Count; i++) { GetMailReward(MailRewardList[i]); } } public static void GetMailReward(MailReward mailReward) { ConfigManager.SaveStringToConfig(PlayerConfigLabel.OneTimeReward, $"{ConfigManager.GetStringFormConfig(PlayerConfigLabel.OneTimeReward)} {mailReward.ID}".Trim(' ')); Transform mailItem = ResourceManager.Get(ResourceLabel.MailItem, Folder.UI, false, ResourceManager.Get(ObjectLabel.Bd_Grid), new Vector3(), ObjType.MailItem); Dictionary childDictionary = new Dictionary(); Auxiliary.CompileDic(mailItem, childDictionary); Text lab = childDictionary[MailItemLabel.Title].GetComponent(); Image Icon1 = childDictionary[MailItemLabel.Icon1].GetComponent(); Image Icon2 = childDictionary[MailItemLabel.Icon2].GetComponent(); Image Icon3 = childDictionary[MailItemLabel.Icon3].GetComponent(); if (mailReward.Key == "pack") { SkillRoot skillRoot; if (Manager.SkillDictionary.TryGetValue($"{SkillConfigLabel.Pack}{mailReward.Value}", out skillRoot)) { Pack pack = (Pack) skillRoot; pack.OnBuySucceed(); float newSpriteSize = 0.35f; Icon2.SetActive(false); Icon3.SetActive(false); Icon1.sprite = pack.Icon; Icon1.Resize(true, newSpriteSize, newSpriteSize); Icon1.transform.localPosition = new Vector2(0, 0); lab.GetComponent().text = pack.Name; InfoBoxManager.GardenInfoBox.Display($"{Language.GetStr(LanguageLabel.Common__Get)} {TransferLabel.PackSprite}{pack.Name}", 10, Color.white, ResourceManager.LoadSprite(ResourceLabel.Atlas, Folder.Atlas)); } else { Debug.LogWarning($"Unknown id {mailReward.Value}"); } } else if (mailReward.Key == "close") { List idList = Auxiliary.StringToInts(' ', mailReward.Value, new List()); CloseItem closeItem; for (int i = 0; i < idList.Count; i++) { if (PlayerManager.CloseItemDictionary.TryGetValue(idList[i], out closeItem)) { if (closeItem.IsBought == false) { closeItem.Unlock(); PlayerManager.BoughtCloseIDs.UniqueAdd(idList[i]); } float newSize = 0.6f; float newSpriteSize = closeItem.PixelSize*newSize/closeItem.Sprites[0].rect.width; closeItem.SetupUI(newSpriteSize, new Vector2(), Icon1, Icon3, Icon2); lab.text = closeItem.Name; InfoBoxManager.GardenInfoBox.Display($"{Language.GetStr(LanguageLabel.Common__Get)} {TransferLabel.CloseSprite}{closeItem.Name}", 10, Color.white, ResourceManager.LoadSprite(ResourceLabel.Atlas, Folder.Atlas)); } else { Debug.LogWarning($"Unknown id {idList[i]}"); } } } else if (mailReward.Key == "flower") { List idList = Auxiliary.StringToInts(' ', mailReward.Value, new List()); FlowerInfo flowerInfo; for (int i = 0; i < idList.Count; i++) { if (GardenManager.FlowerInfoDictionary.TryGetValue(idList[i], out flowerInfo)) { flowerInfo.Add(); float newSpriteSize = 0.225f; Icon2.SetActive(false); Icon3.SetActive(false); Icon1.sprite = flowerInfo.Icon; Icon1.Resize(true, newSpriteSize, newSpriteSize); Icon1.transform.localPosition = new Vector2(0, 0); lab.text = flowerInfo.Name; InfoBoxManager.GardenInfoBox.Display($"{Language.GetStr(LanguageLabel.Common__Get)} {TransferLabel.FlowerSprite}{flowerInfo.Name}", 10, Color.white, ResourceManager.LoadSprite(ResourceLabel.Atlas, Folder.Atlas)); } else { Debug.LogWarning($"Unknown id {idList[i]}"); } } } else if (mailReward.Key == "coin") { Manager.AddCoin(double.Parse(mailReward.Value), StaticsManager.ItemID.获得金币, StaticsManager.ConsumeModule.Mail); float newSpriteSize = 0.75f; Icon2.SetActive(false); Icon3.SetActive(false); Icon1.sprite = ResourceManager.LoadSprite(ResourceLabel.Gold, Folder.UI); Icon1.Resize(true, newSpriteSize, newSpriteSize); Icon1.transform.localPosition = new Vector2(0, 0); lab.text = Auxiliary.ShrinkNumberStr(double.Parse(mailReward.Value)); InfoBoxManager.GardenInfoBox.Display($"{Language.GetStr(LanguageLabel.Common__Get)} {TransferLabel.CoinSprite}{Auxiliary.ShrinkNumberStr(double.Parse(mailReward.Value))}", 10, Color.white, ResourceManager.LoadSprite(ResourceLabel.Atlas, Folder.Atlas)); } else if (mailReward.Key == "diamond") { Manager.AddDiamond(double.Parse(mailReward.Value), StaticsManager.ItemID.获得钻石, StaticsManager.ConsumeModule.Mail); float newSpriteSize = 0.75f; Icon2.SetActive(false); Icon3.SetActive(false); Icon1.sprite = ResourceManager.LoadSprite(ResourceLabel.Diamond, Folder.UI); Icon1.Resize(true, newSpriteSize, newSpriteSize); Icon1.transform.localPosition = new Vector2(0, 0); lab.text = Auxiliary.ShrinkNumberStr(double.Parse(mailReward.Value)); InfoBoxManager.GardenInfoBox.Display($"{Language.GetStr(LanguageLabel.Common__Get)} {TransferLabel.DiamondSprite}{Auxiliary.ShrinkNumberStr(double.Parse(mailReward.Value))}", 10, Color.white, ResourceManager.LoadSprite(ResourceLabel.Atlas, Folder.Atlas)); } else { Debug.Log(mailReward.Key); } } public static void DecodeMailXmlStr(string mailXml) { MailRewardList = new List(); XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.LoadXml(mailXml); } catch (Exception) { return; } XmlNodeList rewardNodeList = xmlDoc.SelectSingleNode("mail").SelectNodes("OneTimeReward"); List receivedIdList = Auxiliary.StringToStrings(' ', ConfigManager.GetStringFormConfig(PlayerConfigLabel.OneTimeReward), new List()); for (int i = 0; i < rewardNodeList.Count; i++) { string id = rewardNodeList[i].SelectSingleNode("id").InnerText; if (receivedIdList.Contains(id)) { continue; } DateTime startTime = DateTime.Parse(rewardNodeList[i].SelectSingleNode("start").InnerText); DateTime endTime = DateTime.Parse(rewardNodeList[i].SelectSingleNode("end").InnerText); if (CurrentDateTime < startTime || CurrentDateTime > endTime) { continue; } XmlNodeList targetIdNodeList = rewardNodeList[i].SelectSingleNode("targets").SelectNodes("id"); for (int j = 0; j < targetIdNodeList.Count; j++) { if (targetIdNodeList[j].InnerText == ID) { XmlNodeList xmlNodeList = rewardNodeList[i].SelectSingleNode("reward").ChildNodes; for (int k = 0; k < xmlNodeList.Count; k++) { MailRewardList.Add(new MailReward(id, xmlNodeList[k].Name, xmlNodeList[k].InnerText)); } break; } } } } public static void GetBuyPackLimitFlag() { GetUrlAddress ( data => { BuyPackLimitFlag = Auxiliary.StringToBool(data["l"][0]["val"].ToJson().Trim('"'), true); if (Application.platform == RuntimePlatform.Android) { BuyPackLimitFlag = true; } if (ConfigManager.configDocument != null) { ConfigManager.SaveBoolToConfig(PlayerConfigLabel.PackLock, BuyPackLimitFlag); } } ); } public static void GetAlipayFlag() { GetUrlAddress ( data => { IAPManager.UseAlipayOnIOS = Auxiliary.StringToBool(data["l"][2]["val"].ToJson().Trim('"'), false); } ); } public static void GetProductID(string id, URLRequest.URLRequestCallBackDelegate callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("t", 1); urlData.Add("i", id); urlData.Add("u", LoginCallbackData.Inst_Object["i"].ToJson().Trim('"')); URLRequest.CreateStrURLRequest(true, GetProductIDURL, urlData, callback, URLRequest.Method.POST); } public static void Login(URLRequest.URLRequestJsonCallBackDelegate callback = null) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", SystemInfo.deviceUniqueIdentifier); URLRequest.CreateURLRequest(false, LoginURL, urlData, LoginCallback + callback, URLRequest.Method.POST); } private static void LoginCallback(JsonData jsonData) { Inited = true; if (jsonData.Inst_Object.ContainsKey("c")) { IsConnect = true; LoginCallbackData = jsonData; CurrentDateTime = DateUtil.GetTime(jsonData["time"].ToJson()); PraiseAmt = int.Parse(jsonData["p"].ToJson().Trim('"')); if (ConfigManager.PlayerDocumentDamageFlag) { ID = jsonData["o"].ToString(); SerialNumber = jsonData["i"].ToString(); } else if (ConfigManager.configDocument != null) { if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.ID) == PlayerConfigLabel.DefaultID) { ID = jsonData["o"].ToString(); if (Initializer.Inited) { ResourceManager.SetText(ObjectLabel.L_UserLab, ID); } } if (ConfigManager.GetStringFormConfig(PlayerConfigLabel.SerialNumber) == PlayerConfigLabel.DefaultID) { SerialNumber = LoginCallbackData["i"].ToString(); } } if (FirstTimeConnectFlag) { FirstTimeConnectFlag = false; StaticsManager.GetInstance().ActOrReg(ID, DataEyeGA.AccountType.Official); } } else { IsConnect = false; } } public static void UploadConfig() { Manager.UploadConfigTimer = 0; URLRequestData urlData = new URLRequestData(); urlData.Add("u", SerialNumber); urlData.Add("v", ReplayVersion); ConfigManager.SaveConfigDocument(); urlData.Add("l", ConfigManager.ConfigDocument.OuterXml); URLRequest.CreateURLRequest(false, SaveURL, urlData, data => {}, URLRequest.Method.POST); } public static void GetTargetConfig(string id, URLRequest.URLRequestJsonCallBackDelegate callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", id); URLRequest.CreateURLRequest(true, OtherURL, urlData, callback, URLRequest.Method.POST); } public static void GetConfigByID(string id, URLRequest.URLRequestJsonCallBackDelegate callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", id); URLRequest.CreateURLRequest(true, DownloadURL, urlData, callback, URLRequest.Method.POST); } public static void GetConfigBySerialNumber(string serialNumber, URLRequest.URLRequestJsonCallBackDelegate callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("u", serialNumber); URLRequest.CreateURLRequest(true, DownloadURL, urlData, callback, URLRequest.Method.POST); } public static void GetRandomConfig(URLRequest.URLRequestJsonCallBackDelegate callback) { URLRequestData urlData = new URLRequestData(); urlData.Add("i", ""); URLRequest.CreateURLRequest(false, RandomURL, urlData, callback, URLRequest.Method.POST); } public static void GetThanksGiftInfo(Action callback, Action failed) { URLRequestData urlData = new URLRequestData(); URLRequest.CreateURLRequest ( false, ThanksGiftInfoURL, urlData, jData => { if (jData.Inst_Object.ContainsKey("l")) { callback.Invoke(jData["l"]); } else { failed.Invoke(); } } ); } private static string SmtpHost = "smtp.163.com"; private static string ReporterMailAccount = "dashgamegarden@163.com"; private static string ReporterMailPassword = "cs670cs"; public static void ReportIssue() { ResourceManager.Get(ObjectLabel.Lb_Info).TweenBacCG(); string emailAddress = ResourceManager.Get(ObjectLabel.Lb_InputLab0).text; if (string.IsNullOrEmpty(emailAddress) || !emailAddress.Contains("@")) { Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Lb_Send3)); return; } string content = ResourceManager.Get(ObjectLabel.Lb_InputLab).text; if (string.IsNullOrEmpty(content)) { Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Lb_Send2)); } else if(ReportIssueContent == content) { Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Lb_Send1)); } else { MailMessage mailMessage = new MailMessage(); mailMessage.To.Add(new MailAddress(ReportMailAddress)); mailMessage.From = new MailAddress(ReporterMailAccount); ReportIssueContent = content; mailMessage.Body = emailAddress + '\n' + ReportIssueContent + '\n' + GetSystemInfo(); mailMessage.Subject = ID + " MyLovelyGargen Issue"; SmtpClient smtpClient = new SmtpClient(SmtpHost); smtpClient.Credentials = new MyCredentials(ReporterMailAccount, ReporterMailPassword); smtpClient.SendAsync(mailMessage, "Async"); Bubble.Show(null, Language.GetStr(LanguageLabel.UI__Lb_Send0)); } } public static string GetSystemInfo() { StringBuilder sb = new StringBuilder(); sb.AppendLine("deviceType :" + SystemInfo.deviceType.ToString()); sb.AppendLine("deviceName :" + SystemInfo.deviceName.ToString()); sb.AppendLine("deviceModel :" + SystemInfo.deviceModel.ToString()); sb.AppendLine("deviceUniqueIdentifier :" + SystemInfo.deviceUniqueIdentifier.ToString()); sb.AppendLine("graphicsDeviceID :" + SystemInfo.graphicsDeviceID.ToString()); sb.AppendLine("graphicsDeviceType :" + SystemInfo.graphicsDeviceType.ToString()); sb.AppendLine("graphicsDeviceName :" + SystemInfo.graphicsDeviceName.ToString()); sb.AppendLine("graphicsShaderLevel :" + SystemInfo.graphicsShaderLevel.ToString()); sb.AppendLine("graphicsMemorySize :" + SystemInfo.graphicsMemorySize.ToString()); sb.AppendLine("graphicsDeviceVersion :" + SystemInfo.graphicsDeviceVersion.ToString()); sb.AppendLine("graphicsMultiThreaded :" + SystemInfo.graphicsMultiThreaded.ToString()); sb.AppendLine("graphicsDeviceVendor :" + SystemInfo.graphicsDeviceVendor.ToString()); sb.AppendLine("graphicsDeviceVendorID :" + SystemInfo.graphicsDeviceVendorID.ToString()); sb.AppendLine("npotSupport :" + SystemInfo.npotSupport.ToString()); sb.AppendLine("maxTextureSize :" + SystemInfo.maxTextureSize.ToString()); sb.AppendLine("operatingSystem :" + SystemInfo.operatingSystem.ToString()); sb.AppendLine("operatingSystemFamily :" + SystemInfo.operatingSystemFamily.ToString()); sb.AppendLine("processorType :" + SystemInfo.processorType.ToString()); sb.AppendLine("processorCount :" + SystemInfo.processorCount.ToString()); sb.AppendLine("processorFrequency :" + SystemInfo.processorFrequency.ToString()); sb.AppendLine("copyTextureSupport :" + SystemInfo.copyTextureSupport.ToString()); sb.AppendLine("graphicsMultiThreaded :" + SystemInfo.graphicsMultiThreaded.ToString()); sb.AppendLine("supportedRenderTargetCount :" + SystemInfo.supportedRenderTargetCount.ToString()); sb.AppendLine("supports3DTextures :" + SystemInfo.supports3DTextures.ToString()); sb.AppendLine("supports2DArrayTextures :" + SystemInfo.supports2DArrayTextures.ToString()); sb.AppendLine("supportsAccelerometer :" + SystemInfo.supportsAccelerometer.ToString()); sb.AppendLine("supportsAudio :" + SystemInfo.supportsAudio.ToString()); sb.AppendLine("supportsComputeShaders :" + SystemInfo.supportsComputeShaders.ToString()); sb.AppendLine("supportsCubemapArrayTextures :" + SystemInfo.supportsCubemapArrayTextures.ToString()); sb.AppendLine("supportsGyroscope :" + SystemInfo.supportsGyroscope.ToString()); sb.AppendLine("supportsImageEffects :" + SystemInfo.supportsImageEffects.ToString()); sb.AppendLine("supportsInstancing :" + SystemInfo.supportsInstancing.ToString()); sb.AppendLine("supportsLocationService :" + SystemInfo.supportsLocationService.ToString()); sb.AppendLine("supportsMotionVectors :" + SystemInfo.supportsMotionVectors.ToString()); sb.AppendLine("supportsRawShadowDepthSampling :" + SystemInfo.supportsRawShadowDepthSampling.ToString()); sb.AppendLine("supportsRenderToCubemap :" + SystemInfo.supportsRenderToCubemap.ToString()); sb.AppendLine("supportsShadows :" + SystemInfo.supportsShadows.ToString()); sb.AppendLine("supportsSparseTextures :" + SystemInfo.supportsSparseTextures.ToString()); sb.AppendLine("supportsVibration :" + SystemInfo.supportsVibration.ToString()); sb.AppendLine("systemMemorySize :" + SystemInfo.systemMemorySize.ToString()); sb.AppendLine("usesReversedZBuffer :" + SystemInfo.usesReversedZBuffer.ToString()); return sb.ToString(); } }