IEnumerator Start() { yield return null; client.Connect(JgRefs.ins_.app.serverIP, JgRefs.ins_.app.serverPort); yield return new WaitForSeconds(0.2f); DummyEntry(); yield return new WaitForSeconds(0.2f); // Request a match if (ansLogin != null && ansLogin.Usn > 0) { ReqMatch req = new ReqMatch(); msg.WriteToServer(JgC2S_Msgs.kReqMatch, req, OnNtfMatch); } // yield return new WaitForSeconds(1); // // yield return new WaitForSeconds(1); }
void HandleMessage(JStateObject state, ReqMatch req) { JgUserInfo userInfo = users[state.gsn]; JgGameRoom room = FindRoom(userInfo.gameLevel); if (room == null) { Debug.Log("Couldn't find a room . \n"); } else { state.roomIndex = room.RoomIndex(); room.AddParticipant(state); if (room.ParticipantCount() == 2) { room.SetPlayerNationsAndNewMatch(); } } }
void DelayedRequestMatch() { ReqMatch req = new ReqMatch(); JgRefs.ins_.msg.SendMessageToServer(JgC2S_Msgs.kReqMatch, req); }