Ejemplo n.º 1
0
    int CEntityParent::init(lua_State* L)
    {
        m_mymb.m_nEntityId = m_id;
        m_mymb.m_nServerMailboxId = GetMailboxId();
        m_mymb.m_nEntityType = m_etype;

        return 0;
    }
Ejemplo n.º 2
0
// 关闭服务器
// 向BaseappMgr 发送 关闭消息
int world::ShutdownServer(T_VECTOR_OBJECT* p)
{
	LogInfo("world::shutdown_server", "");

	//回应cwmd,本进程已经退出
	RpcCall(SERVER_BASEAPPMGR, MSGID_BASEAPPMGR_ON_SERVER_SHUTDOWN, GetMailboxId());
	//设置服务器退出标记
	GetServer()->Shutdown();

	return 0;
}
Ejemplo n.º 3
0
void CBaseappServer::OnShutdownServer()
{
    //get over with the left pluto
    this->HandleLeftPluto();

    //response the "cwmd" that it has logout
    GetWorld()->RpcCall(SERVER_BASEAPPMGR, MSGID_BASEAPPMGR_ON_SERVER_SHUTDOWN, GetMailboxId());
    //only the way can send the pluto to "cwmd"
    this->HandleLeftPluto();

    CEpollServer::OnShutdownServer();
}
Ejemplo n.º 4
0
// 将指定的 pluto 发给 对应的服务器mailbox
bool world::PushPlutoToMailbox(uint16_t nServerId, CPluto* u)
{
	if(GetMailboxId() == nServerId)
	{
		//本服务器
		GetServer()->AddLocalRpcPluto(u);
	}
	else
	{
		CMailBox* mb = GetServerMailbox(nServerId);
		if(mb)
		{
			mb->PushPluto(u);
		}
	}

	return true;
}
Ejemplo n.º 5
0
    int CWorldOther::ShutdownServer(T_VECTOR_OBJECT* p)
    {
        LogDebug("CWorldOther::ShutdownServer", "");

        GetServer()->Shutdown();

        g_bShutdown = true;
        //回应cwmd,本进程已经退出

        SyncRpcCall(g_pluto_sendlist, SERVER_BASEAPPMGR, MSGID_BASEAPPMGR_ON_SERVER_SHUTDOWN, GetMailboxId());

        return 0;
    }