Ejemplo n.º 1
0
void SessionServer::initSession(SessionState *session)
{
	session->setHistoryLimit(_historyLimit);
	session->setPersistenceAllowed(allowPersistentSessions());

	connect(session, &SessionState::userConnected, this, &SessionServer::moveFromLobby);
	connect(session, &SessionState::userDisconnected, this, &SessionServer::userDisconnectedEvent);
	connect(session, &SessionState::sessionAttributeChanged, [this](SessionState *ses) { emit sessionChanged(SessionDescription(*ses)); });

	_sessions.append(session);

	emit sessionCreated(session);
	emit sessionChanged(SessionDescription(*session));
}
Ejemplo n.º 2
0
void SessionServer::initSession(Session *session)
{
	session->setHistoryLimit(_historyLimit);
	session->setPersistenceAllowed(allowPersistentSessions());
	session->setWelcomeMessage(welcomeMessage());

	connect(session, &Session::userConnected, this, &SessionServer::moveFromLobby);
	connect(session, &Session::userDisconnected, this, &SessionServer::userDisconnectedEvent);
	connect(session, &Session::sessionAttributeChanged, [this](Session *ses) { emit sessionChanged(SessionDescription(*ses)); });

	connect(session, &Session::requestAnnouncement, this, &SessionServer::announceSession);
	connect(session, &Session::requestUnlisting, this, &SessionServer::unlistSession);

	_sessions.append(session);

	emit sessionCreated(session);
	emit sessionChanged(SessionDescription(*session));
}