Пример #1
0
int Script::GetDupRgnPlayerMaxNum(const CGUID& regionGuid)
{
	CServerRegion* region = GameManager::GetInstance()->GetRgnManager()->FindRgnByRgnGUID(regionGuid);
	if(region==NULL)
		return EXEC_ERROR;

	switch((eRgnType)region->GetRgnType())
	{
	case RGN_PERSONAL:
		return GlobalSetup::GetSetup()->lPDupRgnMaxPlayerNum;

	case RGN_PERSONAL_HOUSE:
		return GlobalSetup::GetSetup()->lPHDupRgnMaxPlayerNum;

	case RGN_TEAM:
		return GlobalSetup::GetSetup()->lTDupRgnMaxPlayerNum;

	default:
		return EXEC_ERROR;
	}
}
Пример #2
0
void Script::EditDupRgnName(const CGUID& regionGuid, const char* regionName)
{
	if(regionName==NULL)
		return;

	CServerRegion* region = GameManager::GetInstance()->GetRgnManager()->FindRgnByRgnGUID(regionGuid);
	if(region==NULL)
		return;

	region->SetName(regionName);
	if(m_RunEnv.srcShape==NULL)
		return;

	// 发送消息给客户端
	CMessage msg(MSG_S2C_RGN_CHANGENAME);
	msg.Add((long)region->GetRgnType());
	msg.Add(region->GetExID());
	msg.Add(region->GetID());
	msg.Add(region->GetResourceID());
	msg.Add((char*)region->GetName());
	msg.SendToPlayer(m_RunEnv.srcShape->GetExID());
}