Esempio n. 1
0
void ConnectionGraph::HandleDroppedConnection(RakPeerInterface *peer, SystemAddress systemAddress, unsigned char packetId)
{
	RakAssert(peer);
	RemoveParticipant(systemAddress);
	DataStructures::OrderedList<SystemAddress,SystemAddress> ignoreList;
	RemoveAndRelayConnection(ignoreList, packetId, systemAddress, peer->GetExternalID(systemAddress), peer);
}
Esempio n. 2
0
void ReplicaManager::OnClosedConnection(SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason )
{
	(void) systemAddress;
	(void) rakNetGUID;
	(void) lostConnectionReason;

	RemoveParticipant(systemAddress);
}
Esempio n. 3
0
void ReplicaManager::OnCloseConnection(RakPeerInterface *peer, PlayerID playerId)
{
	RemoveParticipant(playerId);
}
Esempio n. 4
0
void Canal::SendByCanal(const QString &message, AuthentificationSystem::AuthentificationSystemPtr System, QTcpSocket *Socket)
{
    AddParticipant(System, Socket);
    SendMessageOnCanal(System, message);
    RemoveParticipant(System);
}
Esempio n. 5
0
    bool Call::AddParticipant(int peerId, std::string& peerName, bool bRemoteCall)
    {
        if(m_Observers.end() != m_Observers.find(peerId))
        {
            return false;
        }
        
        if(NULL != m_pEvtQ && true == bRemoteCall)
        {
            ThreadSafeMessageQueue::ParsedMessage event;
            event["type"] = "RemotePeerCall";
            event["message"] = peerName;
            m_pEvtQ->PostMessage(event);
        }
        
        
#if(defined(GOCAST_ENABLE_VIDEO) && defined(GOCAST_LINUX))
        if(false == IsActive())
        {

            std::string title = "me";
            m_pLocalRenderer = VideoRenderer::Create(
                                    
                                    title,
                                    GOCAST_DEFAULT_RENDER_WIDTH,
                                    GOCAST_DEFAULT_RENDER_HEIGHT
                               );
            if(false == m_pLocalRenderer->Init())
            {
                VideoRenderer::Destroy(m_pLocalRenderer);
                return false;
            }
            
            m_pMediaEngine->SetVideoCapture(true);
            m_pMediaEngine->SetLocalRenderer(m_pLocalRenderer);
        }
#endif

        m_Participants[peerId] = peerName;
        m_Observers[peerId] = new PeerConnectionObserver(
                                        m_pMsgQ,
                                        &m_pWorkerThread,
                                        &m_pPeerConnectionFactory
                                  );
        
        if(false == bRemoteCall)
        {
            if(false == m_Observers[peerId]->ConnectToPeer(peerId,peerName))
            {
                RemoveParticipant(peerId, true);
                return false;
            }
        }
        else
        {
            m_Observers[peerId]->SetPeerId(peerId);
            m_Observers[peerId]->SetPeerName(peerName);            
        }

        ListParticipants();
        
        return true;
    }