lobby.cpp 726 Bytes
#include "lobby.h"
#include "user.h"
#include <lobby_gateway.pb.h>
#include "lobby_service.h"
#include <proto_header.h>

bool lobby_mgr_t::is_in_lobby()
{
	return NULL != this->lobby_service;
}

void lobby_mgr_t::out_lobby(bool notify_lobby)
{
	if (!this->is_in_lobby()){
		return;
	}

	if (notify_lobby){
		lobby_gateway_msg::lobby_out_msg out;
		this->user->lobby_mgr.lobby_service->send_msg(&out, user->uid(), lobby_gateway_lobby_out_msg_cmd);
	}
	this->init_lobby();
}

lobby_mgr_t::lobby_mgr_t()
{
	this->user = NULL;

	this->init_lobby();
}

void lobby_mgr_t::enter_lobby( lobby_service_t* new_lobby_service )
{
	this->lobby_service = new_lobby_service;
}

void lobby_mgr_t::init_lobby()
{
	this->lobby_service = NULL;
}