lobby.cpp
726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#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;
}