public void UserInfo() { //JCE.JceEventBanner (Ag.mySelf); Ag.LogIntenseWord("Login_Register.cs :: UserInfo >> KKO ID :::::: " + Ag.mySelf.WAS.KkoID); WasUserInfo aObj = new WasUserInfo() { User = Ag.mySelf, flag = 1 }; aObj.messageAction = (int pInt) => { switch (pInt) { case 0: LocalSettingSave(); PriceItem(); //Ag.mySelf.CheckFirstDailyEventToday (); break; case -1: case 4: return; } Ag.mySelf.WAS.profileURL = StcPlatform.ProfileURL; AgStt.NodeClose(); AgStt.NodeOpen(); }; }
public void RegistUserInfo() { Ag.LogIntenseWord(" RegistUserInfo KKO ID :::::: " + Ag.mySelf.WAS.KkoID); WasUserInfo aObj = new WasUserInfo() { User = Ag.mySelf, flag = 1 }; aObj.messageAction = (int pInt) => { switch (pInt) // 0:성공 { case 0: //UniformInit (); //Ag.mVirServer.SetUniform (); UniformInit(); RegistUniform(); RegCardUpdate(); break; case -1: case 4: return; } Ag.mySelf.WAS.profileURL = StcPlatform.ProfileURL; AgStt.NodeClose(); AgStt.NodeOpen(); }; }
//public bool IsOK { get { return WAS && Node; } } public NetException() { ConnectLossAct += () => { // WAS Error or Time out ... Lte <--> Wifi Ag.LogIntenseWord(" Connection Loss Event "); // Gaming ... if (Ag.CurrentScene == "GAME") // ignore ? send leave.. timeout... //return; { Ag.NodeObj.LeaveMyself(); } ConnectLossSignalGone = true; // popup open.. }; // mUIpopup.SetActive (true); // NetworkPopup.cs 에서 처리함. NodeConnectionLossAct = () => { Ag.LogIntenseWord(" Connection Loss Event @ Node "); AgStt.NodeClose(); // Gaming ... if (Ag.CurrentScene == "GAME") { Ag.LogDouble(" Node Connection Loss Evnt >>> In GAME << ..... _____ "); ConnectLossSignalGone = true; return; } // Auto Restart Node .... AgStt.NodeOpen(); Ag.LogDouble(" NetException :: Node .... End ..... _____ "); }; }
private static void PrintALine(string pStr, bool WichTig = false) { if (mDisableLog) { return; } RuntimePlatform plat = Application.platform; if (AgStt.DebugOnDevice) { if (WichTig) { AgStt.arrLogWichtig.Add(pStr); } else { AgStt.arrLogOnDevice.Add(pStr); } AgStt.SetDeviceLog(); return; } string theTime = "< " + DateTime.Now.Minute + " : " + DateTime.Now.Second + " > "; if (plat == RuntimePlatform.OSXEditor || plat == RuntimePlatform.Android) { Debug.Log(theTime + pStr); } if (plat == RuntimePlatform.IPhonePlayer) { GeneralFunction.NativeLog("U3D_C# : " + theTime + pStr); } }
public void FetchEventList() { if (Ag.NodeObj == null) { AgStt.NodeOpen(); } if (Ag.rootingFlag) { mPopup2.SetActive(true); //dicMenuList ["alert_rooting"].SetActive (true); return; } WasEventList aObj = new WasEventList() { User = Ag.mySelf }; aObj.messageAction = (int pInt) => { switch (pInt) { case 0: InappPurchaseSotre(); break; case 1: break; case -1: case 4: break; } aObj = null; }; WasPopupStoreList bObj = new WasPopupStoreList() { User = Ag.mySelf }; bObj.messageAction = (int pInt) => { switch (pInt) { case 0: break; } bObj = null; }; }
public override void OnGUI() { Rect curRUp = BotGUI.GetRect(0, 10); // Bot Test Tool... Skip Tutorial int colN = 2, colEA = 5; /* * if (GUI.Button (BotGUI.DivideRect (curRUp, colEA, colN++), Ag.BotTestSetting + " : B : " + Ag.mVirServer.maiGradeOfBot)) { // Update * Ag.BotTestSetting++; * Ag.BotTestSetting = (Ag.BotTestSetting > 4) ? -1 : Ag.BotTestSetting; * } * if (GUI.Button (BotGUI.DivideRect (curRUp, colEA, colN++), "Tutor")) { * PreviewLabs.PlayerPrefs.SetBool ("DidTutorial", true); * PreviewLabs.PlayerPrefs.Flush (); * } */ if (!(Ag.mIsDebug && AgStt.DebugOnDevice)) { return; } muiCol = 0; muiRow = 0; GUI.contentColor = Color.yellow; int idx = 0; GUI.Button(myGUI.GetRect(muiCol++, muiRow), AgStt.GetLogString(idx++, true)); GUI.Button(myGUI.GetRect(muiCol, muiRow), AgStt.GetLogString(idx, true)); idx = muiCol = 0; muiRow = 1; GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); muiCol = muiRow = 1; GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); GUI.Button(myGUI.GetRect(muiCol, muiRow++), AgStt.GetLogString(idx++)); }
public static void HtLog(this string pStr) { if (AgStt.DebugOnDevice) { AgStt.arrLogOnDevice.Add(pStr + "\n"); AgStt.SetDeviceLog(); return; } string theTime = "< " + DateTime.Now.Minute + " : " + DateTime.Now.Second + " > "; if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.Android) { Debug.Log(theTime + " HtLOG >> " + pStr + " \n"); } else { //GeneralFunction.NativeLog("Ag.LogString >>>>>>>>>>>>>>>>>>>> [ " + pStr + " ]"); GeneralFunction.NativeLog("UNITY C# Log :: " + pStr); } }
/// <summary> /// WithDrawOK /// </summary> public void Btn_Fun_withDrawOk() { MenuCommonOpen("Ui_Popup", "game_withdraw", false); Ag.mGameStartAlready = false; dicMenuList ["CenterCircle"].SetActive(true); //AgStt.GoToLoginAfterRegist = false; WasUnRegist aObj = new WasUnRegist() { User = Ag.mySelf }; //AgStt.GoToLoginAfterRegist = false; aObj.messageAction = (int pInt) => { dicMenuList ["CenterCircle"].SetActive(false); switch (pInt) // 0:성공 { case 0: KakaoNativeExtension.Instance.deleteUser(this.onDeleteUserInfoComplete, this.onDeleteUserInfoError); KakaoNativeExtension.Instance.Unregister(onUnregisterComplete, onUnregisterError); //KakaoNativeExtension.Instance.Logout (onLogoutComplete, onLogoutError); Ag.PlatformLogout = true; AgStt.NodeClose(); PreviewLabs.PlayerPrefs.SetBool("DidTutorial", false); //튜토리얼 모드 ON PreviewLabs.PlayerPrefs.Flush(); Application.LoadLevel("Title"); break; case 1: Ag.LogString(" Regist : Success "); //AgStt.GoToLoginAfterRegist = true; //StNet.Login(Ag.mySelf, out goToLogin); break; case -1: case 4: return; } }; }
public void Recover() { ConnectLossSignalGone = false; if (WAS.HasValue && WAS.Value) { WAS = null; } if (Platform.HasValue && Platform.Value) { Platform = null; } //if (Node.HasValue && Node.Value) { AgStt.NodeClose(); AgStt.NodeOpen(); WasLogin aObj = new WasLogin() { User = Ag.mySelf, osVer = "1.1" }; aObj.messageAction = (int pInt) => { aObj = null; }; }
public override void OnApplicationQuit() { Ag.LogIntenseWord(" OnApplicationQuit"); AgStt.NodeClose(); }
public void OnApplicationPause(bool pauseStatus) { if (AgStt.NetManager == null) { return; } Ag.LogIntenseWord(" OnApplicationPause Status Going Out ? :: " + pauseStatus); //#if UNITY_IPHONE //if (Application.platform == RuntimePlatform.IPhonePlayer && AgStt.IntendedPause) { if (AgStt.IntendedPause) { Ag.LogIntenseWord(" OnApplicationPause Skip AgStt.IntendedPause is True || Intended.. "); if (pauseStatus) { AgStt.NodeClose(); } else { AgStt.NodeOpen(); AgStt.IntendedPause = false; } return; } //#endif if (pauseStatus) // going out // iPhone Home Button is pressed ... { AgStt.NodeClose(); willReboot = Ag.GameStt.WillLoadTitleScene; PauseStartTime = DateTime.Now; //if (AgStt.IsGaming.HasValue && AgStt.IsGaming.Value) { // Escape during Gaming.. //if (Ag.GameStt.WillSendWasGameReport) { // Escape during Gaming.. //if (Application.loadedLevelName == "GameScene") { //GameObject.Find ("MainControllView").GetComponent<GameScene> ().dicGameSceneMenuList ["popup"].SetActive (true); //GameObject.Find ("MainControllView").GetComponent<GameScene> ().dicGameSceneMenuList ["alert_out"].SetActive (true); // WasGameReport aObj = new WasGameReport () { // User = Ag.mySelf, winnerID = Ag.NetExcpt.GamingEnemyID, loserID = Ag.mySelf.WAS.KkoID, // winPo = Ag.NetExcpt.GamingEnemyPoint, losPo = 0 // }; // aObj.messageAction = (int pInt) => { // }; // arrJobs [arrJobs.Count - 1].SendJob (); //} else { 502 //GameObject.Find ("Axis/Camera/Match").GetComponent<MenuManager> ().MenuCommonOpen ("alert_someoneout", "Ui_popup", true); 502 //} //} } else // came back { AgStt.NodeOpen(); Ag.GameStt.FocusBack(); if (arrJobs != null) { arrJobs.Clear(); } if (willReboot) // || (Ag.mSingleMode && Ag.mVirServer.maiGradeOfBot >= 0)) { { Ag.LogIntenseWord(" NetworkManager Mono ::: ... WillLoadTitleScene >>> true "); Application.LoadLevel("Title"); return; } if ((DateTime.Now - PauseStartTime).TotalSeconds > 1200) // 1200 20 minutes { Ag.PlatformLogout = true; Application.LoadLevel("Title"); return; } AutoLoginProcess(); } }
public void SetColumnNodeA() { muiCol = 0; muiRow = 1; int colN, colEA; // _////////////////////////////////////////////////_ _///////////////////////_ _____ Connection _____ Ag.NodeObj _____ if (GUI.Button(ndGUI.GetRect(muiCol, muiRow++), " Ag.NodeObj ")) { AgStt.NodeOpen(); } // _////////////////////////////////////////////////_ _///////////////////////_ _____ Connection _____ Node 1 _____ if (node1 == null) { if (GUI.Button(ndGUI.GetRect(muiCol, muiRow++), "ID: " + myUser.WAS.KkoID)) { node1 = new NodeActions(myUser); node1.MySocket.MyUser = myUser; myUser.ShowMyself(); //AgStt.NodeOpen (); //Ag.NodeObj.MySocket.MyUser = myUser; } return; } GUI.Label(myGUI.GetRect(muiCol, muiRow++), " Item " + node1.MyUser.arrItem.Count); // //"88894476708738001"; //"88712330645978192"; "APPS_MOOON_0001"; // "AppsTest088";//"APPS_TEST_ID_0003"; // "AppsTest043"; // "APPS_TEST_ID_0002"; // 88214690633939121<Rolco> 91278098233517152 <Moon iPAD> 88712330645978192 <Moon> 88159078716546208 <Cho> //"90060594732486160"; //"88894476708738001";//"APPS_TEST_ID_0002"; 90060594732486160 88306087115705857 90060594732486160 <KimDR> Rect nodeR1 = ndGUI.GetRect(muiCol, muiRow++); colN = 0; colEA = 4; if (GUI.Button(ndGUI.DivideRect(nodeR1, colEA, colN++), "Fnd " + node1.MySocket.arrFriends.Count)) // Friend List { node1.FriendsInfo(friendList); } if (GUI.Button(ndGUI.DivideRect(nodeR1, colEA, colN++), "Invite")) { node1.InviteAFriend(user2.WAS.KkoID); // node2.MyUser.WAS.KkoID); } // if (GUI.Button (ndGUI.DivideRect (nodeR1, colEA, colN++), "UserMod")) { // node1.UserModify ("ONLINE", statusOnly: true); // } // if (GUI.Button (ndGUI.DivideRect (nodeR1, colEA, colN++), "Leave")) { // node1.LeaveMyself (); // } // _////////////////////////////////////////////////_ _____ Login _____ Net Failure _____ Rect rctTmr = myGUI.GetRect(muiCol, muiRow++); colN = 0; colEA = 3; if (GUI.Button(myGUI.DivideRect(rctTmr, colEA, colN++), "Leave")) { node1.LeaveMyself(); } if (GUI.Button(myGUI.DivideRect(rctTmr, colEA, colN++), "Close")) { AgStt.NodeClose(); } // if (GUI.Button (myGUI.DivideRect (rctTmr, colEA, colN++), "Timer")) { // node1.MySocket.TimerSet (); // } // // if (GUI.Button (myGUI.DivideRect (rctTmr, colEA, colN++), "Cancel")) { // node1.MySocket.TimerStop (); // } // _////////////////////////////////////////////////_ _____ Node _____ Exchange _____ Rect nodeR2 = ndGUI.GetRect(muiCol, muiRow++); colN = 0; colEA = 4; if (GUI.Button(ndGUI.DivideRect(nodeR2, colEA, colN++), "Exchange ")) { node1.MySocket.ExchangeInfo(); } chNum = int.Parse(GUI.TextField(ndGUI.DivideRect(nodeR2, colEA, colN++), chNum.ToString(), 5)); // GUI.TextField (myGUI.DivideRect (curRegis, 2, 0), chkTeamName, 15); if (GUI.Button(ndGUI.DivideRect(nodeR2, colEA, colN++), "Ex 1 ")) { node1.MySocket.Ex1(chNum); } if (GUI.Button(ndGUI.DivideRect(nodeR2, colEA, colN++), "Ex 3 ")) { node1.MySocket.Ex3(chNum); } if (GUI.Button(ndGUI.GetRect(muiCol, muiRow++), myUser.WAS.KkoID + " " + node1.MySocket.arrGameSend.Count + " : S < Close > R : " + node1.MySocket.arrGameRcvd.Count)) { node1.CloseNet(); node1 = null; return; } if (GUI.Button(ndGUI.GetRect(muiCol, muiRow++), "All Friends")) { node1.MySocket.xxActionTempFriends(); } // // Rect nodeR1a = ndGUI.GetRect (muiCol, muiRow++); // colN = 0; // colEA = 4; // if (GUI.Button (ndGUI.DivideRect (nodeR1a, colEA, colN++), "Golden ")) { // Friend List // node1.GoldenBallEvent (); // } // // Rect nodeR2 = ndGUI.GetRect (muiCol, muiRow++); // colN = 0; // int val = node1.GameStartMsgSent.Mine ? 10 : 0; // val += node1.GameStartMsgSent.Enem ? 1 : 0; // if (GUI.Button (ndGUI.DivideRect (nodeR2, 3, colN++), "Prepr")) { // node1.PrepareGame (); // } // if (GUI.Button (ndGUI.DivideRect (nodeR2, 3, colN++), "Start? " + node1.ReceiveGameStartMsgBoth)) { // node1.StartGameMsg (); // } // if (GUI.Button (ndGUI.DivideRect (nodeR2, 3, colN++), "ReMch? " + node1.RematchBoth)) { // node1.Rematch (); // } // // Rect nodeR11 = ndGUI.GetRect (muiCol, muiRow++); // colN = 0; // if (GUI.Button (ndGUI.DivideRect (nodeR11, 2, colN++), " < Set Delegate > ")) { // node1.PrepareGame (); // } // if (GUI.Button (ndGUI.DivideRect (nodeR11, 2, colN++), " < Game Message > ")) { // node1.HostGameTurn (1); // } // string hostStr = "Null "; // if (node1.AmHost.HasValue) // hostStr = node1.AmHost.Value ? " Host " : " Vstr "; // if (GUI.Button (ndGUI.GetRect (muiCol, muiRow++), hostStr + node1.MySocket.arrGameSend.Count + " : S < Close > R : " + // node1.MySocket.arrGameRcvd.Count)) { // node1.CloseNet (); // node1 = null; // return; // } /* * {"name":"JOIN", * * "args": * [ * * {"channel": * * {"server_id":"1","id":"1_2014050118154511", * * "user1":{"gameStatus":"ONLINE","id":"90060594732486160","teamName":"sefefesfs", * "kkoNick":"Nick2424","league":"PRO_2","contWinTime":"0","strIntArr":"5_5_0_","profileURL":"-","rankIntStr":"3000_0_4000_2_25_9_0_0_5_3_","server_id":"1", * "socket_id":"WJFXHJCXZRo0OGw7iPAK","channel_server_id":"1","channel_id":"1_2014050118154511","channel_user_no":"1","client_ip":"183.101.188.21", * "created_at":"2014-05-01T09:15:40.645Z"}, * * "user2":{"gameStatus":"ONLINE","id":"91278098233517152","teamName":"MMM","kkoNick":"Nickkkkk","league":"PRO_5","contWinTime":"0","strIntArr":"5_5_5_", * "profileURL":"-","rankIntStr":"0_0_3000_0_24_28_0_0_91_101_","server_id":"1","socket_id":"XwIGNsn5hlVftjW_iPAL","channel_server_id":"1","channel_id":"1_2014050118154511", * "channel_user_no":"2","client_ip":"183.101.188.21","created_at":"2014-05-01T09:15:41.070Z"}, * "is_random":false,"is_waiting":false,"to_user_id":"91278098233517152","created_at":"2014-05-01T09:15:45.419Z"}, * * "user":{"gameStatus":"ONLINE","id":"91278098233517152","teamName":"MMM","kkoNick":"Nickkkkk","league":"PRO_5","contWinTime":"0","strIntArr":"5_5_5_","profileURL":"-", * "rankIntStr":"0_0_3000_0_24_28_0_0_91_101_","server_id":"1","socket_id":"XwIGNsn5hlVftjW_iPAL","channel_server_id":"1","channel_id":"1_2014050118154511", * "channel_user_no":"2","client_ip":"183.101.188.21","created_at":"2014-05-01T09:15:41.070Z"} * * } // channel * * ] // args * * } * * //*/ }
// 1 : windows, 2 : iOS, 3 : android, 0 : unknown // _////////////////////////////////////////////////_ _____ Main _____ Methods _____ public override void SendAction() { AgStt.IntendedPause = false; AgStt.ReLoginAction(); osType = 0; #if UNITY_IPHONE osType = 2; #endif #if UNITY_ANDROID osType = 3; #endif Ag.LogString("WasLogin :: SendAction ... Started ... "); SendStr = ""; SendStr = SendStr.AddKeyValue("serviceCode", 100); SendStr = SendStr.AddKeyValue("userID", Ag.mGuest ? "" : User.WAS.KkoID); string str4key = Ag.mGuest ? User.DeviceID : User.WAS.KkoID; // int formatVer = 3; // // string theKey = StcPlatform.TheToken; // Kakao token .. // int formatVer = 2; // string theKey = StNet.GetEncodedPassword (str4key); // Ag.LogIntenseWord (" The Token :: " + theKey); /* * * string theKey = StcPlatform.TheToken; // Kakao token .. */ // string theKey = StNet.GetEncodedPassword (str4key); // // Ag.LogIntenseWord (" The Token :: " + theKey); int formatVer = 3; #if UNITY_EDITOR formatVer = 2; string theKey = StNet.GetEncodedPassword(str4key); #else formatVer = 3; SendStr = SendStr.AddKeyValue("accessToken", StcPlatform.TheToken); Ag.LogIntenseWord(" The Token :: " + StcPlatform.TheToken); #endif SendStr = SendStr.AddKeyValue("encodedPassword", StNet.GetEncodedPassword(str4key)); SendStr = SendStr.AddKeyValue("formatVersion", formatVer); int userType = Ag.mGuest ? 0 : 1; //userType = Ag.mGuest && StNet.GuestUserType0Tried ? 1 : userType; SendStr = SendStr.AddKeyValue("userType", userType); SendStr = SendStr.AddKeyValue("osType", osType); SendStr = SendStr.AddKeyValue("osVersion", osVer); SendStr = SendStr.AddKeyValue("deviceModel", SystemInfo.deviceModel); SendStr = SendStr.AddKeyValue("deviceUUID", User.DeviceID, false); SendStr = SendStr.AddParen(); postAction = () => { " post Action ".HtLog(); User.WAS.WasKey = NdObj ["key"]; User.mServerNum = NdObj ["svrVersion"].AsInt; User.noticeImageUrl = NdObj ["noticeImageUrl"]; // if (NdObj ["result"].AsInt == -1) // go to Regist .. { ; } // Server Version Check.. int svrVersion = NdObj ["svrVersion"].AsInt; // if (AgStt.ClientVersion < svrVersion) // New client has come.. Go to App Store .. // AgStt.mURI = "http://221.143.21.33/api.psy.trd"; // else if (svrVersion < AgStt.ClientVersion) // Review // AgStt.mURI = "http://221.143.21.33/api.psy.trd"; // else // same version Service .. // AgStt.mURI = "http://221.143.21.33/api.psy.trd"; try { User.TimeEventEnd = NdObj ["timeEventEndDate"].ToString().ToDateTime(); } catch { " No timeEventEndDate .... ".HtLog(); } User.loginCount = NdObj ["loginCount"].AsInt; messageAction(Result.result); // 0 : 성공, -1 : 중복, -2 : 허용 불가 이름, 1: 존재하지 않는 사용자 (User.mServerNum.LogWith("svrVersion") + User.WAS.WasKey.LogWith("key") + User.noticeImageUrl.LogWith("notiURL")).HtLog(); (User.TimeEventEnd.ToString().LogWith("TimeEvent") + User.ServerVer.LogWith("Svr Ver")).HtLog(); }; SendAndRciv(); }