コード例 #1
0
 public void OnEnable()
 {
     m_ServerListResponse = new ISteamMatchmakingServerListResponse(OnServerResponded, OnServerFailedToRespond, OnRefreshComplete);
     m_PingResponse       = new ISteamMatchmakingPingResponse(OnServerRespondedPing, OnServerFailedToRespondPing);
     m_PlayersResponse    = new ISteamMatchmakingPlayersResponse(OnAddPlayerToList, OnPlayersFailedToRespond, OnPlayersRefreshComplete);
     m_RulesResponse      = new ISteamMatchmakingRulesResponse(OnRulesResponded, OnRulesFailedToRespond, OnRulesRefreshComplete);
 }
コード例 #2
0
    public void OnEnable()
    {
        m_ServerListRequest = HServerListRequest.Invalid;
        m_ServerQuery       = HServerQuery.Invalid;

        m_ServerListResponse = new ISteamMatchmakingServerListResponse(OnServerResponded, OnServerFailedToRespond, OnRefreshComplete);
        m_PingResponse       = new ISteamMatchmakingPingResponse(OnServerResponded, OnServerFailedToRespond);
        m_PlayersResponse    = new ISteamMatchmakingPlayersResponse(OnAddPlayerToList, OnPlayersFailedToRespond, OnPlayersRefreshComplete);
        m_RulesResponse      = new ISteamMatchmakingRulesResponse(OnRulesResponded, OnRulesFailedToRespond, OnRulesRefreshComplete);
    }
コード例 #3
0
ファイル: SteamApi.cs プロジェクト: dkv01/withSIX.Desktop
            public ServerResponder(IPEndPoint ep, ISteamSession session)
            {
                _session = session;
                _ip      = (uint)BitConverter.ToInt32(ep.Address.GetAddressBytes().Reverse().ToArray(), 0);
                _port    = (ushort)ep.Port;

                _mPingResponse    = new ISteamMatchmakingPingResponse(OnServerResponded, OnServerFailedToRespond);
                _mPlayersResponse = new ISteamMatchmakingPlayersResponse(OnAddPlayerToList, OnPlayersFailedToRespond,
                                                                         OnPlayersRefreshComplete);
                _mRulesResponse = new ISteamMatchmakingRulesResponse(OnRulesResponded, OnRulesFailedToRespond,
                                                                     OnRulesRefreshComplete);
            }
コード例 #4
0
        public IServerInfoRequestHandle requestServerInfo(uint ip, ushort port, ServerInfoRequestReadyCallback callback)
        {
            SteamworksServerInfoRequestHandle steamworksServerInfoRequestHandle = new SteamworksServerInfoRequestHandle(callback);
            ISteamMatchmakingPingResponse     steamMatchmakingPingResponse      = new ISteamMatchmakingPingResponse(new ISteamMatchmakingPingResponse.ServerResponded(steamworksServerInfoRequestHandle.onServerResponded), new ISteamMatchmakingPingResponse.ServerFailedToRespond(steamworksServerInfoRequestHandle.onServerFailedToRespond));

            steamworksServerInfoRequestHandle.pingResponse = steamMatchmakingPingResponse;
            HServerQuery query = SteamMatchmakingServers.PingServer(ip, port + 1, steamMatchmakingPingResponse);

            steamworksServerInfoRequestHandle.query = query;
            SteamworksMatchmakingService.serverInfoRequestHandles.Add(steamworksServerInfoRequestHandle);
            return(steamworksServerInfoRequestHandle);
        }
コード例 #5
0
        public SteamworksClient(Connection conn) : base(conn)
        {
            SupportsAuthentification = true;
            Callback <P2PSessionRequest_t> .Create(OnP2PSessionRequest);

            Callback <P2PSessionConnectFail_t> .Create(OnP2PSessionConnectFail);

            SteamUtils.SetWarningMessageHook(OnAPIWarningMessage);
            _serverPingResponse = new ISteamMatchmakingPingResponse(OnPingResponded, OnPingFailedToRespond);
            Callback <PersonaStateChange_t> .Create(OnPersonaStateChange);

            Callback <GameServerChangeRequested_t> .Create(OnGameServerChangeRequested);

            Callback <GameRichPresenceJoinRequested_t> .Create(OnGameRichPresenceJoinRequested);
        }
コード例 #6
0
        private IEnumerator DelayedServerInviteReceived(uint ip, ushort port)
        {
            this.QueryingIp = ip;
            ISteamMatchmakingPingResponse response = new ISteamMatchmakingPingResponse(new ISteamMatchmakingPingResponse.ServerResponded(this.ServerResponded), new ISteamMatchmakingPingResponse.ServerFailedToRespond(this.ServerFailedToRespond1));
            HServerQuery query = SteamMatchmakingServers.PingServer(ip, port, response);

            while (SteamClientDSConfig.Server == null)
            {
                if (string.IsNullOrEmpty(this.invitedToIP))
                {
                    yield break;
                }
                yield return(null);
            }
            yield return(YieldPresets.WaitPointFiveSeconds);

            Debug.Log("Received DS invite for server name='" + SteamClientDSConfig.Server.GetServerName() + "'");
            this._inviteReceivedScreen._continueSaveButton.isEnabled = SaveSlotUtils.GetPreviouslyPlayedServers().Contains(SteamClientDSConfig.Guid);
            this._inviteReceivedScreen._gameName.text = SteamClientDSConfig.Server.GetServerName();
            this._inviteReceivedScreen._screen.SetActive(true);
            this._menu.SetActive(false);
            UICamera.hoveredObject = null;
            yield break;
        }
コード例 #7
0
 private void ServerFailedToRespond1()
 {
     Debug.Log("AutoJoin: Server ping failed " + this.invitedToIP + ", trying with port 27016");
     ISteamMatchmakingPingResponse pRequestServersResponse = new ISteamMatchmakingPingResponse(new ISteamMatchmakingPingResponse.ServerResponded(this.ServerResponded), new ISteamMatchmakingPingResponse.ServerFailedToRespond(this.ServerFailedToRespond2));
     HServerQuery hserverQuery = SteamMatchmakingServers.PingServer(this.QueryingIp, 27016, pRequestServersResponse);
 }
コード例 #8
0
ファイル: steam_api_interop.cs プロジェクト: bmer/Mammoth
 public override uint PingServer(uint unIP,char usPort,ISteamMatchmakingPingResponse pRequestServersResponse)
 {
     CheckIfUsable();
     uint result = NativeEntrypoints.SteamAPI_ISteamMatchmakingServers_PingServer(m_pSteamMatchmakingServers,unIP,usPort,pRequestServersResponse.GetIntPtr());
     return result;
 }
コード例 #9
0
ファイル: steam_api_interop.cs プロジェクト: bmer/Mammoth
 public abstract uint PingServer(uint unIP,char usPort,ISteamMatchmakingPingResponse pRequestServersResponse);