コード例 #1
0
	void OnLobbyMatchList(LobbyMatchList_t pCallback, bool bIOFailure) {
		if (bIOFailure) {
			ESteamAPICallFailure reason = SteamUtils.GetAPICallFailureReason(m_LobbyMatchListCallResult.Handle);
			Debug.LogError("OnLobbyMatchList encountered an IOFailure due to: " + reason);
			return; // TODO: Recovery
		}

		Debug.Log("[" + LobbyMatchList_t.k_iCallback + " - LobbyMatchList] - " + pCallback.m_nLobbiesMatching);

		if (pCallback.m_nLobbiesMatching == 0) {
			ChangeState(EChatClientState.NoLobbiesFound);
			return;
		}

		m_Lobbies = new Lobby[pCallback.m_nLobbiesMatching];
		for (int i = 0; i < pCallback.m_nLobbiesMatching; ++i) {
            UpdateLobbyInfo(SteamMatchmaking.GetLobbyByIndex(i), ref m_Lobbies[i]);

			/*uint IP;
			ushort Port;
			CSteamID GameServerSteamID;
			bool lobbyGameServerRet = SteamMatchmaking.GetLobbyGameServer(m_Lobbies[i].m_SteamID, out IP, out Port, out GameServerSteamID);
			print("IP: " + IP);
			print("Port: " + Port);
			print("GSID: " + GameServerSteamID);*/

		}

		ChangeState(EChatClientState.DisplayResults);
	}
コード例 #2
0
	void OnLobbyCreated(LobbyCreated_t pCallback, bool bIOFailure) {
		if (bIOFailure) {
			ESteamAPICallFailure reason = SteamUtils.GetAPICallFailureReason(m_LobbyCreatedCallResult.Handle);
			Debug.LogError("OnLobbyCreated encountered an IOFailure due to: " + reason);
			return; // TODO: Recovery
		}

		Debug.Log("[" + LobbyCreated_t.k_iCallback + " - LobbyCreated] - " + pCallback.m_eResult + " -- " + pCallback.m_ulSteamIDLobby);

        UpdateLobbyInfo((CSteamID)pCallback.m_ulSteamIDLobby, ref m_CurrentLobby);

		ChangeState(EChatClientState.InLobby);
	}
コード例 #3
0
    private void OnLobbyMatchList(LobbyMatchList_t pCallback, bool bIOFailure)
    {
        if (bIOFailure)
        {
            var reason = SteamUtils.GetAPICallFailureReason(m_LobbyMatchListCallResult.Handle);
            Debug.LogError("OnLobbyMatchList encountered an IOFailure due to: " + reason);
            return;
        }
        if (pCallback.m_nLobbiesMatching == 0)
        {
            return;
        }

        m_Lobbies = new Lobby[pCallback.m_nLobbiesMatching];
        for (var i = 0; i < pCallback.m_nLobbiesMatching; ++i)
        {
            UpdateLobbyInfo(SteamMatchmaking.GetLobbyByIndex(i), ref m_Lobbies[i]);
        }
        DesplayList();
    }
コード例 #4
0
	void OnLobbyEnter(LobbyEnter_t pCallback, bool bIOFailure) {
		if (bIOFailure) {
			ESteamAPICallFailure reason = SteamUtils.GetAPICallFailureReason(m_LobbyEnterCallResult.Handle);
			Debug.LogError("OnLobbyEnter encountered an IOFailure due to: " + reason);
			return; // TODO: Recovery
		}

		Debug.Log("[" + LobbyEnter_t.k_iCallback + " - LobbyEnter] - " + pCallback.m_ulSteamIDLobby + " -- " + pCallback.m_rgfChatPermissions + " -- " + pCallback.m_bLocked + " -- " + (EChatRoomEnterResponse)pCallback.m_EChatRoomEnterResponse);
		
		m_LobbyEnterResponse = (EChatRoomEnterResponse)pCallback.m_EChatRoomEnterResponse;
		
		if(m_LobbyEnterResponse != EChatRoomEnterResponse.k_EChatRoomEnterResponseSuccess) {
			ChangeState(EChatClientState.FailedToJoin);
			return;
		}
		
		m_CurrentLobby.m_SteamID = (CSteamID)pCallback.m_ulSteamIDLobby;
		m_CurrentLobby.m_Members = new LobbyMembers[SteamMatchmaking.GetNumLobbyMembers(m_CurrentLobby.m_SteamID)];
		m_CurrentLobby.m_MemberLimit = SteamMatchmaking.GetLobbyMemberLimit(m_CurrentLobby.m_SteamID);

		ChangeState(EChatClientState.InLobby);
	}