📄 bubble_server.h
字号:
// Bubble_Server.h: interface for the Bubble_Server class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_Bubble_Server_H__1C03E390_0396_4E2B_97EB_DFDA7A0DFEF9__INCLUDED_)
#define AFX_Bubble_Server_H__1C03E390_0396_4E2B_97EB_DFDA7A0DFEF9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define SERVER_PORT 32327
//struct USER_INFO
//{
// uint16 uid_player; //游戏中角色的id
// uint32 uid_session; //连接会话的id
// uint32 uid_server; //所属游戏世界服务器的会话id
//};
class Bubble_Server
{
public:
bool save_user_info(GameUser* ptr_user);
bool register_user(GameUser& user, const char* strName);
GameUser* find_user(const char* strName);
void on_update_table_info(GameTable* pTable);
void on_user_leave_table(GameTable* pTable, GameUser* pUser);
void BroadcastPacket(NET_Packet* pPacket, ULONG id_except=0);
GameTable* get_table(USHORT id_table);
void on_user_enter_table(ULONG id_user, USHORT id_table);
GameUser* get_user(ULONG id_user);
void StopServer();
bool StartServer();
int get_online_count();
int get_thread_count();
bool IsActive();
void DoUpdate();
void Shutdown();
BOOL InitServer();
Bubble_Server();
virtual ~Bubble_Server();
TCP_Socket m_socket_player;
TCP_Socket m_socket_game;
// TCP_Socket
protected:
virtual void on_login(uint16 uid) {return;}
virtual void on_logout(uint16 uid) {return;}
Thread_Pool m_thread_pool;
std::map<ULONG, GameUser> m_map_user_info;
std::map<USHORT, GameTable> m_map_game;
};
#endif // !defined(AFX_Bubble_Server_H__1C03E390_0396_4E2B_97EB_DFDA7A0DFEF9__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -