Exemplo n.º 1
0
	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);
	}
Exemplo n.º 2
0
	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();
			}
		}
	}
Exemplo n.º 3
0
	void DelayedRequestMatch()
	{
		ReqMatch req = new ReqMatch();
		JgRefs.ins_.msg.SendMessageToServer(JgC2S_Msgs.kReqMatch, req);

	}