// // show lists of members, listenList, and talkList // void plNetClientMgr::IShowRooms() { plDebugText &txt = plDebugText::Instance(); int y,x; const int yOff=10, xOff=300, startY=70, startX=10; char str[256]; // OWNEDLIST x=startX; y=startY; txt.DrawString(x,y,"RoomsOwned",255,255,255,255,plDebugText::kStyleBold); y+=yOff; std::set<plNetClientGroups::OwnedGroup>::iterator it=GetNetGroups()->fGroups.begin(); for(;it != GetNetGroups()->fGroups.end(); it++) { if ((*it).fOwnIt) { sprintf(str, "%s", (*it).fGroup.GetDesc()); txt.DrawString(x,y,str); y+=yOff; } } // NOTOWNEDLIST x+=xOff; y=startY; txt.DrawString(x,y,"RoomsNotOwned",255,255,255,255,plDebugText::kStyleBold); y+=yOff; it=GetNetGroups()->fGroups.begin(); for(;it != GetNetGroups()->fGroups.end(); it++) { if (!(*it).fOwnIt) { sprintf(str, "%s", (*it).fGroup.GetDesc()); txt.DrawString(x,y,str); y+=yOff; } } }
// // returns yes/no // for special cases, like sceneNodes. // int plNetClientMgr::IsLocallyOwned(const plUoid& uoid) const { // we're non-networked if ( GetFlagsBit(kDisabled)) return plSynchedObject::kYes; plNetGroupId netGroup = uoid.GetLocation(); int answer=GetNetGroups()->IsGroupLocal(netGroup); if (answer==-1) answer = IDeduceLocallyOwned(uoid); hsAssert(answer==plSynchedObject::kYes || answer==plSynchedObject::kNo, "invalid answer to IsLocallyOwned()"); return answer; }
// // check if this object is in a group which is owned (mastered) by this client. // returns yes/no // int plNetClientMgr::IsLocallyOwned(const plSynchedObject* obj) const { // we're non-networked if ( GetFlagsBit(kDisabled) ) return plSynchedObject::kYes; if( !obj ) return plSynchedObject::kNo; // object is flagged as local only if (!obj->IsNetSynched()) return plSynchedObject::kYes; plNetGroupId netGroup = GetEffectiveNetGroup(obj); int answer=GetNetGroups()->IsGroupLocal(netGroup); if (answer==-1) // not sure answer = IDeduceLocallyOwned(obj->GetKey()->GetUoid()); hsAssert(answer==plSynchedObject::kYes || answer==plSynchedObject::kNo, "invalid answer to IsLocallyOwned()"); return answer; }