示例#1
0
void Servatrice::addIslInterface(int serverId, IslInterface *interface)
{
    // Only call with islLock locked for writing
    
    islInterfaces.insert(serverId, interface);
    connect(interface, SIGNAL(externalUserJoined(ServerInfo_User)), this, SLOT(externalUserJoined(ServerInfo_User)));
    connect(interface, SIGNAL(externalUserLeft(QString)), this, SLOT(externalUserLeft(QString)));
    connect(interface, SIGNAL(externalRoomUserJoined(int, ServerInfo_User)), this, SLOT(externalRoomUserJoined(int, ServerInfo_User)));
    connect(interface, SIGNAL(externalRoomUserLeft(int, QString)), this, SLOT(externalRoomUserLeft(int, QString)));
    connect(interface, SIGNAL(externalRoomSay(int, QString, QString)), this, SLOT(externalRoomSay(int, QString, QString)));
    connect(interface, SIGNAL(externalRoomGameListChanged(int, ServerInfo_Game)), this, SLOT(externalRoomGameListChanged(int, ServerInfo_Game)));
    connect(interface, SIGNAL(joinGameCommandReceived(Command_JoinGame, int, int, int, qint64)), this, SLOT(externalJoinGameCommandReceived(Command_JoinGame, int, int, int, qint64)));
    connect(interface, SIGNAL(gameCommandContainerReceived(CommandContainer, int, int, qint64)), this, SLOT(externalGameCommandContainerReceived(CommandContainer, int, int, qint64)));
    connect(interface, SIGNAL(responseReceived(Response, qint64)), this, SLOT(externalResponseReceived(Response, qint64)));
    connect(interface, SIGNAL(gameEventContainerReceived(GameEventContainer, qint64)), this, SLOT(externalGameEventContainerReceived(GameEventContainer, qint64)));
}
示例#2
0
void IslInterface::sessionEvent_ServerCompleteList(const Event_ServerCompleteList &event)
{
	for (int i = 0; i < event.user_list_size(); ++i) {
		ServerInfo_User temp(event.user_list(i));
		temp.set_server_id(serverId);
		emit externalUserJoined(temp);
	}
	for (int i = 0; i < event.room_list_size(); ++i) {
		const ServerInfo_Room &room = event.room_list(i);
		for (int j = 0; j < room.user_list_size(); ++j) {
			ServerInfo_User userInfo(room.user_list(j));
			userInfo.set_server_id(serverId);
			emit externalRoomUserJoined(room.room_id(), userInfo);
		}
		for (int j = 0; j < room.game_list_size(); ++j) {
			ServerInfo_Game gameInfo(room.game_list(j));
			gameInfo.set_server_id(serverId);
			emit externalRoomGameListChanged(room.room_id(), gameInfo);
		}
	}
}
示例#3
0
void IslInterface::sessionEvent_UserJoined(const Event_UserJoined &event)
{
	ServerInfo_User userInfo(event.user_info());
	userInfo.set_server_id(serverId);
	emit externalUserJoined(userInfo);
}