public bool ParseCards(JSONNode pData) { Ag.LogStartWithStr(1, " [< AmUserNet.cs >] <<<<< ParseCards >>>>> >> " + pData.Count); pData.ToString().HtLog(); try { arrCard.Clear(); for (int k = 0; k < pData.Count; k++) { Ag.LogIntense(1, true); Ag.LogString(pData [k].ToString() + " k : " + k); AmCard aObj = new AmCard(); // if (k == 0) { // 임 시 로 키 퍼 세 팅. // aObj.WAS.isKicker = false; // //polyNum = 101; // } else // aObj.WAS.isKicker = true; //if (aObj.WAS.ParseFrom (pData [k])) aObj.WAS.WasCardParse(pData [k]); aObj.ScouterParse(); arrCard.Add(aObj); } } catch { Ag.LogIntenseWord(" [< AmUserNet.cs >] Parse <<<<< ParseCards >>>>> E R R O R :: "); return(false); } return(true); }
public override void Start() { Ag.LogIntenseWord(" UnitTest.cs :: Start "); myGUI = new AmUI(); myGUI.SetColumns(2, 20); mTimeLooseAtStartPoint = 0.5f; base.Start(); //GameObject gObj = AgStt.Dic ["some"] ["anoth"]; // Test ID Setting .... WAS, Node related ...... etc... // Stadium = FindGameObject ("prefab_Polygon/Stadium/Stadium2", true); // Stadium = FindGameObject ("Stadium2", true); // GetPrefabAt ("prefab_Polygon/Stadium", "Stadium2");// Resources.Load<GameObject> ( "prefab_Polygon/Stadium/Stadium2"); // StartCoroutine (CrtnMethod ()); Ag.LogString("// _////////////////////////////////////////////////_ _____ Test _____ Test Started _____"); MtCompact compObj = new MtCompact(24); compObj.AddNum(6); // total num ... including this .. compObj.AddNum(12); compObj.AddNum(9); compObj.AddNum(23); compObj.AddNum(0); compObj.AddNum(12); compObj.ParseSelf(); Ag.LogIntense(5, false); }
public static void Show(this UiState pObj, string cmnt = " >> ") { Ag.LogIntense(1, true); Ag.LogString(" UIClasses :: ...... " + cmnt.LogWith("=========================================== ") + pObj.LogWith("State")); Ag.LogIntense(1, false); }
public void ResFriends(IMessage theData) { TimerStop(); Ag.LogStartWithStr(1, mName + " ResFriends Rcvd ... \t\t\t\t >>> Re Action <<<"); JSONNode argsJ = GetArguments(theData, mName); // JsonMapper.ToObject (dataJ ["args"] [0].ToJson ()); string status = argsJ ["status"]; int frdNum = argsJ ["friends"].Count; JSONNode friends = argsJ ["friends"]; Ag.LogString("status :: >> " + status + " , My Friend Num is ::: " + frdNum); arrFriends = new List <NodeUser> (); for (int k = 0; k < frdNum; k++) { Ag.LogString(" ________ . . . . . . . . . A Friend :: " + friends [k]); NodeUser aFrnd = new NodeUser(friends [k]); // = JsonMapper.ToObject<NodeUser> (friends [k]); if (aFrnd.ParseIntArr()) { arrFriends.Add(aFrnd); } Ag.LogString(" ________ . . . . . . . . . >>>> Parsed :: " + aFrnd.ToString()); //Ag.LogString (" ________ " + k + " A Friend :: " + aFrnd.ToString ()); } Ag.LogIntense(2, false); }
void ResInviteMirror(IMessage theData) { TimerStop(); Ag.LogIntense(1, true); Ag.LogString(mName + " ResInvite Rcvd ... \t\t\t\t >>> Re Action <<<"); Ag.LogString(" >>> " + theData.MessageText); JSONNode argsJ = GetArguments(theData, mName); // JsonMapper.ToObject (dataJ ["args"] [0].ToJson ()); string status = argsJ ["status"]; if (status == "FAIL") { if (argsJ ["code"] == "ERR_NOSUCHUSER") // ERR_NOSUCHUSER { InviteErrorOf("OFFLINE"); } else // ERR_USERONCHANNEL { InviteErrorOf("RANDOM"); } } IsGameHost = true; Ag.LogIntense(2, false); }
public static void ShowEachChar(this byte[] pByte, string pComment) // [2013:3:26:MOON] Added.. { Ag.LogIntense(3, true); (" >>>>> HtExtendMethodStr :: ShowEachChar >>>>>>>>>>>>>>>>>>>>> >>>>> " + pComment + " <<<<<").HtLog(); Ag.LogString(pComment); int ii, num = BitConverter.ToUInt16(pByte, 12) + 14; for (ii = 0; ii < num; ii++) { byte cur; cur = pByte [ii]; string hexOutput = String.Format("{0:X}", cur); //System.Text.Encoding.ASCIIEncoding.GetBytes(x.ToString()); if (ii == 14) { Ag.LogString("______________________________ Above are Header ______________________________"); } Ag.LogString("Cur byte is:>> \t\t 0x " + hexOutput + ", \t at \t ____ " + ii + " \t ____ \t DEC : " + cur + " \t _____ \t" + ((char)cur).ToString()); } Ag.LogString("______________________________ Total Length = " + num + "\n"); (" >>>>> HtExtendMethodStr :: ShowEachChar >>>>>>>>>>>>>>>>>>>>> >>>>> " + pComment + " <<<<<").HtLog(); Ag.LogIntense(3, false); }
void SendGameTurnResult(int turnN) { Ag.LogIntense(2, true); //string myRoll = ((TurnNum % 2 == 1) ^ (MySocket.IsGameHost.Value)) ? "KICK" : "KEEP"; string myRoll; // = ((TurnNum % 2 == 1) ^ (!MySocket.IsGameHost.Value)) ? "KICK" : "KEEP"; if (TurnNum % 2 == 1) { myRoll = MySocket.IsGameHost.Value ? "KICK" : "KEEP"; } else { myRoll = MySocket.IsGameHost.Value ? "KEEP" : "KICK"; } MyUser.WAS.GameSessionKey = MySocket.sessionKey; NodeGameTurnRslt gameTurn = new NodeGameTurnRslt() { roll = myRoll, direction = Direction, skill = Skill, turnNum = turnN, sessionKey = MySocket.sessionKey, grade = CurMyCard.WAS.grade, level = CurMyCard.WAS.level }; Ag.LogString(MySocket.mName + " NodeAction :: GameTurn " + TurnNum + " My Roll is " + myRoll); Ag.LogString(MySocket.mName + " NodeAction :: GameTurn Send >>> my <Dir/Skl> : <<< " + Direction + " / " + Skill + " >>>"); MySocket.ActionGameObj(gameTurn); Ag.LogString(MySocket.mName + " NodeAction :: GameTurn _____ Sent !!! "); Ag.LogIntense(2, false); }
void ResUserMod(IMessage theData) { TimerStop(); Ag.LogIntense(1, true); Ag.LogString(mName + " ResUserMod Rcvd ... \t\t\t\t >>> Re Action <<<"); Ag.LogString(" >>> " + theData.MessageText); Ag.LogIntense(2, false); }
public void ShowMyself() { Ag.LogIntense(4, true); "_____ Am Direction :: Show Myself _____ _____ Am Direction :: Show Myself _____".HtLog(); (" mWidth " + mWidth [0] + " , \t " + mWidth [1] + " , \t " + mWidth [2] + " , \t " + mWidth [3] + " >>>>> ").HtLog(); (" mPosition " + mPosition [0] + " , \t " + mPosition [1] + " , \t " + mPosition [2] + " , \t " + mPosition [3] + " >>>>> ").HtLog(); Ag.LogIntense(4, false); }
public static void LogNewScene(string pSceneName, string pFuncName) { if (pFuncName == "Start") { Ag.LogIntense(5, true); Debug.Log(" Scene is Loaded >>>>>>>>>>>>>>>>>>>>> {Scene :: " + pSceneName + " STARTed } ~~~~~~~~~~~~~~~~~~~~~~~~~ \n"); Ag.LogIntense(3, false); } }
// _////////////////////////////////////////////////_ _____ Leave _____ Leave _____ public void ActionLeave() { Ag.LogIntense(2, true); Ag.LogString(mName + " ActionLeave Emit ... \t\t\t\t <<< Action :: Leave .... Game Finish !!!!!!!!! >>>"); //if (JoinMatched) MySocket.Emit("LEAVE", null); Ag.LogString(mName + " ActionLeave Emit ... \t Done .... "); Ag.LogIntense(1, false); }
public void ActionUserModify(string statusGame, bool statusOnly = true) // MATCHING / ONLINE { Ag.LogIntense(2, true); Ag.LogString(mName + " ActionUserModify Emit ... \t\t\t\t <<< Action statusOnly : " + statusOnly + " >>>"); MySocket.Emit("USERMOD", GetCurrentNodeUserDic(statusOnly, statusGame)); // noUser.GetDicObj ()); TimerSet(); Ag.LogIntense(1, false); }
void ResRefuse(IMessage theData) { TimerStop(); Ag.LogIntense(1, true); Ag.LogString(mName + " ResRefuse Rcvd ... \t\t\t\t >>> My invitation is ..... Refused !!!!!... !!!! <<<"); Ag.LogString(" >>> " + theData.MessageText); dlgtIamRefused(); Ag.LogIntense(2, false); }
public void ShowMyself() { Ag.LogIntense(3, true); (" ======================================================================================================= ").HtLog(); (" Name :: " + mName).HtLog(); (" OneBox :: X range >> From " + Xmin + " To " + Xmax + " Y range >> From " + Ymin + " To " + Ymax).HtLog(); (" ======================================================================================================= ").HtLog(); Ag.LogIntense(3, false); }
// _////////////////////////////////////////////////_ _____ User _____ Regist / Modify _____ public void ActionUser() { Ag.LogIntense(2, true); Ag.LogString(mName + " ActionUser Emit ... \t\t\t\t <<< Action >>>"); MySocket.Emit("USER", GetCurrentNodeUserDic(statusOnly: false)); TimerSet(); Ag.LogIntense(1, false); }
// //////////////////////////////////////////////// Simple Sub Methods ... public void AddSimpleOperation(int pF, int pL, Godirum pGod) // 35 78 Plus ... { Ag.LogIntense(3, true); (" HmEquation :: AddSimpleOperation " + pF + " " + pGod.ToString() + " " + pL).HtLog(); SetItemInt(pF, new Vector3(-7, 0, 0)); // Equa, God, Equa... SetGod(pGod, new Vector3(0, 0, 0)); SetItemInt(pL, new Vector3(7, 0, 0)); (" HmEquation :: AddSimpleOperation ___________ End ").HtLog(); Ag.LogIntense(3, false); }
public void RematchRefuse() { Ag.LogStartWithStr(2, mName + " RematchRefuse Emit ... \t\t\t\t <<< Action :: GameMsg >>>"); SendGameMsg(new NodeRematchRefuse()); ReMatchRefuseSend.Mine = true; Ag.LogString(mName + " RematchRefuse Emit ... \t\t\t\t <<< Done >>>"); Ag.LogIntense(1, false); }
// _////////////////////////////////////////////////_ _____ Network _____ Methods _____ void StartThread() { Ag.LogIntense(10, true); Ag.LogIntenseWord("Start Thread"); if (mThread != null) { return; } mThread = new Thread(ThreadWorker); mThread.Start(); }
void ResUser(IMessage theData) { TimerStop(); Ag.LogIntense(1, true); ActionUserModify("ONLINE", true); Ag.LogString(mName + " ResUser Rcvd ... \t\t\t\t >>> Re Action <<< " + RcntRcvdName + " Status " + Status); Ag.LogIntense(2, false); theData.ToString().HtLog(); }
void ResLeaveMirror(IMessage theData) { Ag.LogIntense(1, true); Ag.LogString(mName + " ResLeaveMirror Rcvd ... \t\t\t\t >>> Re Action I left <<<"); Ag.LogString(" >>> " + theData.MessageText); Ag.GameStt.EnemyOrMyselfLeftActionFromNode(myself: true, pComent: " I Left .. "); dlgtIleft(); Ag.LogIntense(2, false); }
// _////////////////////////////////////////////////_ _____ Friends _____ List _____ public void xxActionTempFriends() { Ag.LogStartWithStr(2, mName + " ActionTempFriends Emit ... \t\t\t\t <<< Action >>>"); Dictionary <string, string> aDic = new Dictionary <string, string> (); //aDic ["Key"] = "None"; MySocket.Emit("TMPFRIENDS", aDic); Ag.LogString(mName + " ActionTempFriends Emit ... \t\t\t\t <<< Action Done >>>"); Ag.LogIntense(1, false); }
public void ShowArrArea() { Ag.LogIntense(3, true); // Debug.Log ("m>>>>>>>>>>>m m>>>>>>>>>>>m m>>>>>>>>>>>m m>>>>>>>>>>> ShowArrArea >>>>>>>>>>>m m>>>>>>>>>>>m m>>>>>>>>>>>m m>>>>>>>>>>>m "); for (int ij = 0; ij < arrArea.Count; ij++) { int[] curVal = (int[])arrArea [ij]; // Debug.Log("Dir: <" + curVal[0] + "> Starts: " + curVal[1] + ", Ends: " + curVal[2] ); } Ag.LogIntense(3, false); }
// _////////////////////////////////////////////////_ _____ Emit _____ Action _____ public void ActionGameObj(NodeGameBase gameObj) { Ag.LogIntense(2, true); Ag.LogString(mName + " ActionGameObj Emit ... \t\t\t\t <<< Action :: Game >>>"); if (gameObj.msgType != "REVERSE") { arrGameSend.Add(gameObj); } SendGameMsg(gameObj); Ag.LogIntense(1, false); }
void ResJoinMirror(IMessage theData) { TimerStop(); Ag.LogStartWithStr(1, mName + " ResJoinMirror Rcvd ... \t\t\t\t >>> Re Action <<<"); Ag.LogString(" >>> " + theData.MessageText); IsGameHost = false; //JoinMatched = true; dlgtJoinAsVisitor(); Ag.LogIntense(2, false); }
// _////////////////////////////////////////////////_ _///////////////////////_ _____ Mouse _____ U P _____ public override void MouseUp() { if (muiState == UiState.SPEED_LIMIT) { return; } base.MouseUp(); switch (muiState) { case UiState.SCROLL: case UiState.SCROLL_OFFLIMIT: if (arrTouch.Count < 3) { return; } float del = arrTouch [arrTouch.Count - 1].CurrentPosition(muiOption.scrlVert.Value) - arrTouch [0].CurrentPosition(muiOption.scrlVert.Value); muiFlyingSpeed = del / arrTouch.Count; //Ag.LogIntenseWord (muiFlyingSpeed.LogWith ("FlyingSpeed")); if (Math.Abs(muiFlyingSpeed) > 0.005f || muiSelectedObj == null) { SetState(UiState.FLY); } else { SetState(UiState.NONE); } Ag.LogString(" __________ Mouse Up __________________________________________________________ " + muiState); return; case UiState.SELECTED: Ag.LogDouble(mName.LogWith("Wagu") + " SELECTED :: Reset Switch, Selected Objects ... "); ReleaseHoveringObj(); ReleaseSwitchTarget(); Ag.LogString(" __________ Mouse Up __________________________________________________________ " + muiState); Ag.LogIntense(4, false); break; // return; case UiState.ALIEN_WENT: EventSetAlienToTouchManager(null); Ag.LogString(" __________ Mouse Up __________________________________________________________ " + muiState); return; case UiState.ALIEN_CAME: AlienSwitchProcess(); break; } ReleaseProcess(); SetState(UiState.NONE); }
public void ActionRefuse(AmUser pMe) { Ag.LogStartWithStr(2, mName + " ActionRefuse Emit ... \t\t\t\t <<< Action :: Join >>>"); Dictionary <string, string> dRef = new Dictionary <string, string> (); dRef ["invite_from_user_id"] = CurEnemy.id; dRef ["invite_to_user_id"] = pMe.WAS.KkoID; dRef ["invite_channel_id"] = CurEnemy.channel_id; MySocket.Emit("INVITEREFUSE", dRef); Ag.LogIntense(1, false); }
// _////////////////////////////////////////////////_ _____ Random _____ Matching _____ public void RandomMatching(int pFilter1Same2League) { Ag.LogStartWithStr(2, mName + " RandomMatching Emit ... \t\t\t\t <<< Action :: RandomMatching >>>"); Ag.GameStt.NodeInviteOrRandomAction("RandomMatching"); // EnemyLeft = false; JoinMatched = false; MatchingTimer = new AgTime(); MatchingTimer.WaitTimeFor(0, 0, 5); Dictionary <string, int> dRandom = new Dictionary <string, int> (); dRandom ["filter"] = pFilter1Same2League; //NodeRandom nObj = new NodeRandom () { filter = pFilter1Same2League }; MySocket.Emit("RANDOM", dRandom); //nObj); // TimerSet (); 상대방이 호스트일 때 엇갈리면 안올 수 있다. 제외. Ag.LogIntense(1, false); }
public static void ShowEachBytes(this byte[] pByte, string pComment) // [2013:3:26:MOON] Added.. { Ag.LogIntense(3, true); (" >>>>> HtExtendMethodStr :: ShowEachChar >>>>>>>>>>>>>>>>>>>>> >>>>> " + pComment + " <<<<<").HtLog(); Ag.LogString("Length >> " + pByte.Length); for (int ii = 0; ii < pByte.Length; ii++) { byte cur; cur = pByte [ii]; string hexOutput = String.Format("{0:X}", cur); Ag.LogString("Cur byte is:>> \t\t 0x " + hexOutput + ", \t at \t ____ " + ii + " \t ____ \t DEC : " + cur + " \t _____ \t" + ((char)cur).ToString()); } }
public bool ParseExchange(JSONNode pData, AmUser pEnemy) { Ag.LogStartWithStr(3, "NodeGameObject :: Parse Exchange "); pEnemy = EnAmUser = new AmUser(); Ag.LogString(" >>> User <<< " + pData ["User"].ToString()); JSONNode user = JSON.Parse(pData ["User"].ToString().RecoverFromDodgeStr(" ` ", true)); EnAmUser.WAS.KkoID = user ["KkoID"]; EnAmUser.WAS.KkoNick = user ["KkoNick"]; EnAmUser.KkoNickEncode = user ["KNickEncode"]; Ag.LogString(" >>> " + EnAmUser.WAS.KkoID + EnAmUser.WAS.KkoNick); Ag.LogString(" >>> Item <<< " + pData ["arrItemWas"]); JSONNode arrItm = JSON.Parse(pData ["arrItemWas"].ToString().RecoverFromDodgeStr(" ` ", true)); for (int k = 0; k < arrItm.Count; k++) { Ag.LogString(arrItm [k].ToString()); try { AmItem itm = new AmItem(); itm.ParseFrom(arrItm [k]); itm.ShowMyself(); EnAmUser.arrItem.Add(itm); } catch { Ag.LogString(" :: >>> Item Parse !!!!! E R R O R !!!!! ", pWichtig: true); } } Ag.LogNewLine(2); Ag.LogString(" >>> Uniform <<< " + pData ["arrUniform"]); arrItm = JSON.Parse(pData ["arrUniform"].ToString().RecoverFromDodgeStr(" ` ", true)); for (int k = 0; k < arrItm.Count; k++) { Ag.LogString(arrItm [k].ToString()); AmUniform nUni = new AmUniform(); EnAmUser.arrUniform.Add(nUni); try { nUni.Parse(arrItm [k]); nUni.WasParseColorStringToKickKeepObj(); } catch { Ag.LogString(" :: >>> ParseColorInfo !!!!! E R R O R !!!!! ", pWichtig: true); } } Ag.LogString("NodeGameObject :: Parse Exchange >>>>> >>>>> "); Ag.LogIntense(5, false); return(true); }
// _////////////////////////////////////////////////_ _____ Friend _____ Join / Refuse _____ public void ActionJoin() { Ag.LogStartWithStr(2, mName + " ActionJoin Emit ... \t\t\t\t <<< Action :: Join >>>"); if (CurEnemy == null || CurEnemy.channel_id.Length < 3) { return; } NodeJoin nObj = new NodeJoin(CurEnemy.channel_id); Ag.GameStt.NodeInviteOrRandomAction("ActionJoin"); // EnemyLeft = false; JoinMatched = false; MySocket.Emit("JOIN", nObj); TimerSet(); Ag.LogIntense(1, false); }