void Script::SetRgnStrongPointState(const char* footholdName, int footholdState) { if(footholdName==NULL) return; CServerRegion* region = dynamic_cast<CServerRegion*>(m_RunEnv.region); if(region==NULL) return; region->SetStrongPointState(footholdName, footholdState); // 发送消息通知该场景所有玩家 CMessage msg(MSG_S2C_RGN_STRONGPOINT_STATE_CHANGE); msg.Add((long)region->GetID()); // region id msg.Add(region->GetExID()); // region guid msg.Add(footholdName); // strongpoint name msg.Add((long)footholdState); msg.SendToRegion(region); }
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()); }