mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 12:49:10 +00:00
Add more temporary hack macros to help speed up conversion and testing
This commit is contained in:
@ -619,9 +619,8 @@ void plNetClientMgr::ICheckPendingStateLoad(double secs)
|
||||
if ( !hsgResMgr::ResMgr()->FindKey( tmpUoid ) )
|
||||
{
|
||||
// discard the state if object not found in dataset.
|
||||
char tmp[256];
|
||||
hsLogEntry( DebugMsg( "Failed to find object %s in dataset. Discarding pending state '%s'",
|
||||
tmpUoid.StringIze(tmp),
|
||||
tmpUoid.StringIze().c_str(),
|
||||
pl->fSDRec->GetDescriptor()->GetName() ) );
|
||||
delete pl;
|
||||
it = fPendingLoads.erase(it);
|
||||
@ -663,7 +662,6 @@ void plNetClientMgr::ICheckPendingStateLoad(double secs)
|
||||
double rawSecs = hsTimer::GetSeconds();
|
||||
if ((rawSecs - pl->fQueuedTime) > 60.f /*secs*/)
|
||||
{
|
||||
char tmp[256], tmp2[256];
|
||||
if (pl->fQueueTimeResets >= 5)
|
||||
{
|
||||
// if this is our fifth time in here then we've been queued
|
||||
@ -671,7 +669,7 @@ void plNetClientMgr::ICheckPendingStateLoad(double secs)
|
||||
|
||||
WarningMsg( "Pending state '%s' for object [uoid:%s,key:%s] has been queued for about %f secs. Removing...",
|
||||
pl->fSDRec && pl->fSDRec->GetDescriptor() ? pl->fSDRec->GetDescriptor()->GetName() : "?",
|
||||
pl->fUoid.StringIze(tmp2), pl->fKey ? pl->fKey->GetUoid().StringIze(tmp) : "?",
|
||||
pl->fUoid.StringIze().c_str(), pl->fKey ? pl->fKey->GetUoid().StringIze().c_str() : "?",
|
||||
( rawSecs - pl->fQueuedTime ) * pl->fQueueTimeResets);
|
||||
|
||||
delete pl;
|
||||
@ -681,7 +679,7 @@ void plNetClientMgr::ICheckPendingStateLoad(double secs)
|
||||
|
||||
WarningMsg( "Pending state '%s' for object [uoid:%s,key:%s] has been queued for about %f secs. %s",
|
||||
pl->fSDRec && pl->fSDRec->GetDescriptor() ? pl->fSDRec->GetDescriptor()->GetName() : "?",
|
||||
pl->fUoid.StringIze(tmp2), pl->fKey ? pl->fKey->GetUoid().StringIze(tmp) : "?",
|
||||
pl->fUoid.StringIze().c_str(), pl->fKey ? pl->fKey->GetUoid().StringIze().c_str() : "?",
|
||||
( rawSecs - pl->fQueuedTime ) * pl->fQueueTimeResets,
|
||||
so ? "(not loaded)" : "(not final)" );
|
||||
// reset queue time so we don't spew too many log msgs.
|
||||
@ -938,8 +936,7 @@ hsBool plNetClientMgr::MsgReceive( plMessage* msg )
|
||||
{
|
||||
hsAssert(fAgeSDLObjectKey==nil, "already have a ref to age sdl hook");
|
||||
fAgeSDLObjectKey = ref->GetRef()->GetKey();
|
||||
char tmp[256];
|
||||
DebugMsg("Age SDL hook object created, uoid=%s", fAgeSDLObjectKey->GetUoid().StringIze(tmp));
|
||||
DebugMsg("Age SDL hook object created, uoid=%s", fAgeSDLObjectKey->GetUoid().StringIze().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1149,34 +1146,34 @@ bool plNetClientMgr::CanSendMsg(plNetMessage * msg)
|
||||
// Return the net client (account) name of the player whose avatar
|
||||
// key is provided. If avKey is nil, returns local client name.
|
||||
//
|
||||
const char* plNetClientMgr::GetPlayerName(const plKey avKey) const
|
||||
plString plNetClientMgr::GetPlayerName(const plKey avKey) const
|
||||
{
|
||||
// local case
|
||||
if (!avKey || avKey==GetLocalPlayerKey())
|
||||
return NetCommGetPlayer()->playerNameAnsi;
|
||||
return plString::FromIso8859_1(NetCommGetPlayer()->playerNameAnsi);
|
||||
|
||||
plNetTransportMember* mbr=TransportMgr().GetMember(TransportMgr().FindMember(avKey));
|
||||
return mbr ? mbr->GetPlayerName() : nil;
|
||||
return mbr ? mbr->GetPlayerName() : plString::Null;
|
||||
}
|
||||
|
||||
const char * plNetClientMgr::GetPlayerNameById (unsigned playerId) const {
|
||||
plString plNetClientMgr::GetPlayerNameById (unsigned playerId) const {
|
||||
// local case
|
||||
if (NetCommGetPlayer()->playerInt == playerId)
|
||||
return NetCommGetPlayer()->playerNameAnsi;
|
||||
return plString::FromIso8859_1(NetCommGetPlayer()->playerNameAnsi);
|
||||
|
||||
plNetTransportMember * mbr = TransportMgr().GetMember(TransportMgr().FindMember(playerId));
|
||||
return mbr ? mbr->GetPlayerName() : nil;
|
||||
return mbr ? mbr->GetPlayerName() : plString::Null;
|
||||
}
|
||||
|
||||
unsigned plNetClientMgr::GetPlayerIdByName (const char name[]) const {
|
||||
unsigned plNetClientMgr::GetPlayerIdByName (const plString & name) const {
|
||||
// local case
|
||||
if (0 == StrCmp(name, NetCommGetPlayer()->playerNameAnsi, (unsigned)-1))
|
||||
if (0 == name.Compare(NetCommGetPlayer()->playerNameAnsi))
|
||||
NetCommGetPlayer()->playerInt;
|
||||
|
||||
unsigned n = TransportMgr().GetNumMembers();
|
||||
for (unsigned i = 0; i < n; ++i)
|
||||
if (plNetTransportMember * member = TransportMgr().GetMember(i))
|
||||
if (0 == StrCmp(name, member->GetPlayerName(), (unsigned)-1))
|
||||
if (0 == name.Compare(member->GetPlayerName()))
|
||||
return member->GetPlayerID();
|
||||
return 0;
|
||||
}
|
||||
@ -1483,10 +1480,9 @@ void plNetClientMgr::AddPendingLoad(PendingLoad *pl)
|
||||
pl->fKey = hsgResMgr::ResMgr()->FindKey(pl->fUoid);
|
||||
|
||||
// check for age SDL state
|
||||
char tmp[256];
|
||||
if (pl->fUoid.GetObjectName() && !strcmp(pl->fUoid.GetObjectName(), plSDL::kAgeSDLObjectName))
|
||||
{
|
||||
DebugMsg("Recv SDL state for age hook object, uoid=%s", pl->fUoid.StringIze(tmp));
|
||||
DebugMsg("Recv SDL state for age hook object, uoid=%s", pl->fUoid.StringIze().c_str());
|
||||
if (!pl->fKey)
|
||||
WarningMsg("Can't find age hook object, nil key!");
|
||||
else
|
||||
@ -1499,12 +1495,12 @@ void plNetClientMgr::AddPendingLoad(PendingLoad *pl)
|
||||
if (!pl->fKey->ObjectIsLoaded())
|
||||
{
|
||||
WarningMsg("Object %s not loaded, withholding SDL state",
|
||||
pl->fKey->GetUoid().StringIze(tmp));
|
||||
pl->fKey->GetUoid().StringIze().c_str());
|
||||
}
|
||||
else if (!pl->fKey->ObjectIsLoaded()->IsFinal())
|
||||
{
|
||||
WarningMsg("Object %s is not FINAL, withholding SDL state",
|
||||
pl->fKey->GetUoid().StringIze(tmp));
|
||||
pl->fKey->GetUoid().StringIze().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user