void ReceivedLogin() { if (mLoginEvent.Response.code == 1) { DialogueMgr.ShowDialogue(UtilMgr.GetLocalText("StrServerError"), mCheckEvent.Response.message, DialogueMgr.DIALOGUE_TYPE.Alert, null); } UserMgr.LoginInfo = mLoginEvent.Response.data; int year = int.Parse(mLoginEvent.Response.data.serverTime.Substring(0, 4)); int mon = int.Parse(mLoginEvent.Response.data.serverTime.Substring(4, 2)); int day = int.Parse(mLoginEvent.Response.data.serverTime.Substring(6, 2)); int hour = int.Parse(mLoginEvent.Response.data.serverTime.Substring(8, 2)); int min = int.Parse(mLoginEvent.Response.data.serverTime.Substring(10, 2)); int sec = int.Parse(mLoginEvent.Response.data.serverTime.Substring(12, 2)); System.DateTime dt = new System.DateTime(year, mon, day, hour, min, sec); // Debug.Log("dt is "+dt.ToString("yyyyMMddhhmmss")); System.TimeSpan ts = dt - System.DateTime.Now; UserMgr.DiffTicks = ts.Ticks; // Debug.Log("diff is "+ts.Minutes+":"+ts.Seconds); // Debug.Log("myTime is "+System.DateTime.Now.ToString("yyyyMMddhhmmss")); // Debug.Log("diffTicks are "+UserMgr.DiffTicks); mProfileEvent = new GetProfileEvent(new EventDelegate(ReceivedProfile)); NetMgr.GetProfile(mLoginEvent.Response.data.memSeq, mProfileEvent); }
// IEnumerator GetImage(WWW www,int i) // { // // yield return www; // Texture2D tmpTex = new Texture2D (0, 0); // www.LoadImageIntoTexture (tmpTex); // Count++; // LobbyGiftCommander.mGift.image.Add (i,tmpTex); // if (Count == LobbyGiftCommander.mGift.gift.Count&&TwoCheck) { // Debug.Log("Load Finish"); // TwoCheck = false; // mProfileEvent = new GetProfileEvent (new EventDelegate (this, "GotProfile")); // // NetMgr.GetProfile (mLoginInfo.memSeq, mProfileEvent); // } // } IEnumerator GetImage2(WWW www, string Image) { yield return(www); Texture2D tmpTex = new Texture2D(0, 0); if (Image != "") { www.LoadImageIntoTexture(tmpTex); } Count++; try{ LobbyGiftCommander.mGift.Textures.Add(Image, tmpTex); // Debug.Log("Image name is "+Image); }catch { //Debug.Log("Same Image"); } if (Count == LobbyGiftCommander.mGift.gift.Count && TwoCheck) { Debug.Log("Load Finish"); TwoCheck = false; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "GotProfile")); NetMgr.GetProfile(mLoginInfo.memSeq, mProfileEvent); } }
public void Init(GetProfileEvent profileEvent) { mProfileEvent = profileEvent; Transform infoTop = transform.FindChild("Scroll View").FindChild("InfoTop"); if((mProfileEvent.Response.data.imageName != null) && (mProfileEvent.Response.data.imageName.Length > 0)) Debug.Log("Image is "+mProfileEvent.Response.data.imageName); infoTop.FindChild("Frame").FindChild("Label").GetComponent<UILabel>().text = mProfileEvent.Response.data.nick; infoTop.FindChild("LblAccountBalance").FindChild("Label").GetComponent<UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.gold+""); infoTop.FindChild("LblAccountBalance").FindChild("Label").FindChild("Sprite").localPosition = new Vector3(-(infoTop.FindChild("LblAccountBalance").FindChild("Label").GetComponent<UILabel>().width+5),0); infoTop.FindChild("LblTickets").FindChild("Label").GetComponent<UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.ticket+""); infoTop.FindChild("LblTickets").FindChild("Label").FindChild("Sprite").localPosition = new Vector3(-(infoTop.FindChild("LblTickets").FindChild("Label").GetComponent<UILabel>().width+5),0); infoTop.FindChild("LblRankingPoint").FindChild("Label").GetComponent<UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.rankPoint+""); infoTop.FindChild("LblRankingPoint").FindChild("Label").FindChild("Label").localPosition = new Vector3(-(infoTop.FindChild("LblRankingPoint").FindChild("Label").GetComponent<UILabel>().width+10),0); UtilMgr.LoadUserImage(mProfileEvent.Response.data.photoUrl, infoTop.FindChild("Frame").FindChild("Photo") .FindChild("Texture").GetComponent<UITexture>()); }
// IEnumerator SaveImage(WWW www,int i) // { // // yield return www; // Texture2D tmpTex = new Texture2D (200, 200); // www.LoadImageIntoTexture (tmpTex); // Count++; // Save (tmpTex,i); // if (Count == count&&TwoCheck) { // Debug.Log("Save Finish"); // TwoCheck = false; // mProfileEvent = new GetProfileEvent (new EventDelegate (this, "GotProfile")); // // NetMgr.GetProfile (mLoginInfo.memSeq, mProfileEvent); // } // // } IEnumerator SaveImage2(WWW www, string ImageName) { yield return(www); Texture2D tmpTex = new Texture2D(200, 200); Debug.Log("ImageName : " + ImageName); if (ImageName != "") { www.LoadImageIntoTexture(tmpTex); } Count++; try{ Save2(tmpTex, ImageName); }catch { Debug.Log("Same!!!"); } if (Count == count && TwoCheck) { Debug.Log("Save Finish"); TwoCheck = false; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "GotProfile")); NetMgr.GetProfile(mLoginInfo.memSeq, mProfileEvent); } }
public void Init(GetProfileEvent profileEvent) { mProfileEvent = profileEvent; Transform infoTop = transform.FindChild("Scroll View").FindChild("InfoTop"); if ((mProfileEvent.Response.data.imageName != null) && (mProfileEvent.Response.data.imageName.Length > 0)) { Debug.Log("Image is " + mProfileEvent.Response.data.imageName); } infoTop.FindChild("Frame").FindChild("Label").GetComponent <UILabel>().text = mProfileEvent.Response.data.nick; infoTop.FindChild("LblAccountBalance").FindChild("Label").GetComponent <UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.gold + ""); infoTop.FindChild("LblAccountBalance").FindChild("Label").FindChild("Sprite").localPosition = new Vector3(-(infoTop.FindChild("LblAccountBalance").FindChild("Label").GetComponent <UILabel>().width + 5), 0); infoTop.FindChild("LblTickets").FindChild("Label").GetComponent <UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.ticket + ""); infoTop.FindChild("LblTickets").FindChild("Label").FindChild("Sprite").localPosition = new Vector3(-(infoTop.FindChild("LblTickets").FindChild("Label").GetComponent <UILabel>().width + 5), 0); infoTop.FindChild("LblRankingPoint").FindChild("Label").GetComponent <UILabel>().text = UtilMgr.AddsThousandsSeparator(mProfileEvent.Response.data.rankPoint + ""); infoTop.FindChild("LblRankingPoint").FindChild("Label").FindChild("Label").localPosition = new Vector3(-(infoTop.FindChild("LblRankingPoint").FindChild("Label").GetComponent <UILabel>().width + 10), 0); UtilMgr.LoadUserImage(mProfileEvent.Response.data.photoUrl, infoTop.FindChild("Frame").FindChild("Photo") .FindChild("Texture").GetComponent <UITexture>()); }
public void mDoneIAP() { mProfileEvent = new GetProfileEvent(new EventDelegate(this, "addruby")); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); UserMgr.UserMailCount += 1; DialogueMgr.ShowDialogue("구매 성공", itemproduct + " 구매가 완료 되었습니다.\n우편함을 확인해주세요.", DialogueMgr.DIALOGUE_TYPE.Alert, null); Debug.Log("All PurchaseSucceeded"); }
public void CloseClicked() { if (closeClicked) { return; } closeClicked = true; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "ProfileUpdate")); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); }
/// <summary> /// Gets a player's profile /// </summary> /// <param name="username">The username</param> /// <returns>the player profile if found; otherwise null</returns> public Profile GetProfile(string username) { RequestProfile(username); GetProfileEvent getProfileEvent = WaitForServerEvent <GetProfileEvent>(Timeout); if (getProfileEvent == null) { return(null); } return(getProfileEvent.Profile); }
void UploadFile() { Debug.Log("file name is " + mTempFile); if (mTempFile == null || mTempFile.Length < 1) { return; } mProfileEvent = new GetProfileEvent(new EventDelegate(ReceivedProfile)); JoinMemberInfo memberInfo = new JoinMemberInfo(); memberInfo.Photo = mTempFile; NetMgr.UpdateMemberInfo(memberInfo, mProfileEvent, false, true); }
void LoginComplete() { UtilMgr.DismissLoading(); if (mLoginEvent.Response.code > 0) { Debug.Log("error : " + mLoginEvent.Response.message); if (mLoginEvent.Response.code == 100) { LoginFailed(); } UtilMgr.DismissLoading(); return; } mLoginInfo = mLoginEvent.Response.data; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "GotProfile")); NetMgr.GetProfile(mLoginInfo.memSeq, mProfileEvent); }
/// <summary> /// Processes the message /// </summary> /// <param name="connectionBase">The connection base</param> /// <param name="message">The playerio message</param> /// <param name="handled">Whether the message was already handled</param> public void Process(ConnectionBase connectionBase, Message message, bool handled) { Profile profile = new Profile(); profile.ProfileVisible = string.Compare(message.GetString(0), "public", true) == 0; if (profile.ProfileVisible) { profile.ConnectionId = message.GetString(1); profile.Username = message.GetString(2); profile.Smiley = (FaceID)message.GetInt(3); profile.IsBeta = message.GetBoolean(4); profile.IsModerator = message.GetBoolean(5); profile.IsInBuildersClub = message.GetBoolean(6); profile.BuildersClubMembershipTimeRemaining = message.GetDouble(7); profile.BuildersClubMembershipTime = message.GetDouble(8); profile.BuildersClubMembershipID = message.GetString(9); string room0 = message.GetString(10); profile.Room0 = room0 == string.Empty ? null : new WorldReference(connectionBase.Client, room0); string betaOnlyWorld = message.GetString(11); profile.BetaOnlyWorld = betaOnlyWorld == string.Empty ? null : new WorldReference(connectionBase.Client, betaOnlyWorld); string[] worldList = message.GetString(13).Split(','); profile.OwnedWorlds = new WorldReference[worldList.Length]; for (int i = 0; i < worldList.Length; i++) { profile.OwnedWorlds[i] = new WorldReference(connectionBase.Client, worldList[i]); } } GetProfileEvent getProfileEvent = new GetProfileEvent() { Profile = profile, Raw = message }; connectionBase.RaiseServerEvent <GetProfileEvent>(getProfileEvent); }
public void StartArray() { mProfileEvent = new GetProfileEvent(new EventDelegate(this, "setarrray")); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); }
public void Set() { Sett = false; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "Setting")); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); }
void mIrequestIAP() { mProfileEvent = new GetProfileEvent(new EventDelegate(this, "additem")); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); }
void UploadFile() { Debug.Log("file name is "+mTempFile); if(mTempFile == null || mTempFile.Length < 1){ return; } mProfileEvent = new GetProfileEvent(new EventDelegate(ReceivedProfile)); JoinMemberInfo memberInfo = new JoinMemberInfo(); memberInfo.Photo = mTempFile; NetMgr.UpdateMemberInfo(memberInfo, mProfileEvent, false, true); }
void Getdata() { try{ UIScrollView._CoverFlowCount = LobbyGiftCommander.mGift.gift.Count; count = LobbyGiftCommander.mGift.gift.Count; for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { count += LobbyGiftCommander.mGift.gift [i].detail.Count; } bool Check = false; for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { Debug.Log(PlayerPrefs.GetString(i.ToString()) + " : " + LobbyGiftCommander.mGift.gift [i].image); if (PlayerPrefs.GetString(i.ToString()) != LobbyGiftCommander.mGift.gift [i].image) { Check = true; break; } } #if UNITY_EDITOR if (Check) { Debug.Log("Different, Save to Local"); for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { WWW www = new WWW(Constants.IMAGE_SERVER_HOST + "/gift/" + LobbyGiftCommander.mGift.gift [i].image); Debug.Log(LobbyGiftCommander.mGift.imageurl + "/" + LobbyGiftCommander.mGift.gift [i].image); StartCoroutine(SaveImage2(www, LobbyGiftCommander.mGift.gift [i].image)); PlayerPrefs.SetString(i.ToString(), LobbyGiftCommander.mGift.gift [i].image); for (int a = 0; a < LobbyGiftCommander.mGift.gift[i].detail.Count; a++) { www = new WWW(Constants.IMAGE_SERVER_HOST + "/gift/" + LobbyGiftCommander.mGift.gift [i].detail [a].image); Debug.Log(LobbyGiftCommander.mGift.imageurl + "/" + LobbyGiftCommander.mGift.gift [i].detail [a].image); StartCoroutine(SaveImage2(www, LobbyGiftCommander.mGift.gift [i].detail [a].image)); } } } else { Debug.Log("Same, Load to Local"); for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { WWW www = new WWW("file://" + Application.dataPath + "/" + LobbyGiftCommander.mGift.gift [i].image); StartCoroutine(GetImage2(www, LobbyGiftCommander.mGift.gift [i].image)); PlayerPrefs.SetString(i.ToString(), LobbyGiftCommander.mGift.gift [i].image); for (int a = 0; a < LobbyGiftCommander.mGift.gift[i].detail.Count; a++) { www = new WWW("file://" + Application.dataPath + "/" + LobbyGiftCommander.mGift.gift [i].detail [a].image); StartCoroutine(GetImage2(www, LobbyGiftCommander.mGift.gift [i].detail [a].image)); } } } #else if (Check) { Debug.Log("Different, Save to Local"); for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { WWW www = new WWW(LobbyGiftCommander.mGift.imageurl + "/" + LobbyGiftCommander.mGift.gift [i].image); StartCoroutine(SaveImage2(www, LobbyGiftCommander.mGift.gift [i].image)); PlayerPrefs.SetString(i.ToString(), LobbyGiftCommander.mGift.gift [i].image); for (int a = 0; a < LobbyGiftCommander.mGift.gift[i].detail.Count; a++) { www = new WWW(LobbyGiftCommander.mGift.imageurl + "/" + LobbyGiftCommander.mGift.gift [i].detail [a].image); StartCoroutine(SaveImage2(www, LobbyGiftCommander.mGift.gift [i].detail [a].image)); } } } else { Debug.Log("Same, Load to Local"); for (int i = 0; i < LobbyGiftCommander.mGift.gift.Count; i++) { WWW www = new WWW("file://" + Application.persistentDataPath + "/" + LobbyGiftCommander.mGift.gift [i].image); StartCoroutine(GetImage2(www, LobbyGiftCommander.mGift.gift [i].image)); PlayerPrefs.SetString(i.ToString(), LobbyGiftCommander.mGift.gift [i].image); for (int a = 0; a < LobbyGiftCommander.mGift.gift[i].detail.Count; a++) { www = new WWW("file://" + Application.persistentDataPath + "/" + LobbyGiftCommander.mGift.gift [i].detail [a].image); StartCoroutine(GetImage2(www, LobbyGiftCommander.mGift.gift [i].detail [a].image)); } } } #endif UIScrollView._CoverFlowCount = LobbyGiftCommander.mGift.gift.Count; }catch { Debug.Log("Get gift error"); TwoCheck = false; mProfileEvent = new GetProfileEvent(new EventDelegate(this, "GotProfile")); NetMgr.GetProfile(mLoginInfo.memSeq, mProfileEvent); } }
public void BtnMenuClick() { mProfileEvent = new GetProfileEvent(new EventDelegate(ReceivedProfile)); NetMgr.GetProfile(UserMgr.UserInfo.memSeq, mProfileEvent); }