1
Mac OSX Specific Issues / Merchant XML error
« on: September 09, 2005, 12:50:37 am »
OK, so earlier I and others reported that the merchant window was not showing the items that the merchant will buy or sell, but will still show the categories it will buy/sell. Now, I noticed an error when I started trading with the merchant, or switched between buy/sell. Here it is:
Now, I took a look at the code it references here:
So basically the client is requesting xml data from the server, and the server gives it:
Now the code here is looking for ID and TRADE_CMD, which are present in the string sent to the client here, but somehow doc->GetRoot() does not work.
Code: [Select]
HandleMerchant
:
No XML root in
No XML root in
Now, I took a look at the code it references here:
Code: [Select]
void pawsMerchantWindow::HandleMerchant( const char* merchantData )
{
Show();
csRef xml = CS_QUERY_REGISTRY( windowManager->GetObjectRegistry(), iDocumentSystem );
csRef doc = xml->CreateDocument();
if(!doc)
{
Error2(\"Parse error in %s\", merchantData );
return;
}
csRef merchant = doc->GetRoot();
if(!merchant)
{
Error2(\"No XML root in %s\", merchantData);
return;
}
csRef data = merchant->GetNode(\"MERCHANT\");
if(!data)
{
Error2(\"No tag in %s\", merchantData);
return;
}
merchantID = data->GetAttributeValueAsInt( \"ID\" );
tradeCommand = data->GetAttributeValueAsInt( \"TRADE_CMD\" );
bool buy = true;
if ( tradeCommand == psGUIMerchantMessage::SELL )
{
buy = false;
}
pawsRadioButtonGroup* group = (pawsRadioButtonGroup*)FindWidget(\"BuySell\");
if ( buy )
group->SetActive( \"Buy\" );
else
group->SetActive( \"Sell\" );
}
So basically the client is requesting xml data from the server, and the server gives it:
Now the code here is looking for ID and TRADE_CMD, which are present in the string sent to the client here, but somehow doc->GetRoot() does not work.