本文整理汇总了C++中PlayerObject::isConnected方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerObject::isConnected方法的具体用法?C++ PlayerObject::isConnected怎么用?C++ PlayerObject::isConnected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerObject
的用法示例。
在下文中一共展示了PlayerObject::isConnected方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleObjectMenuSelect
void InsuranceTerminal::handleObjectMenuSelect(uint8 messageType,Object* srcObject)
{
PlayerObject* playerObject = (PlayerObject*)srcObject;
if (playerObject && playerObject->isConnected())
{
// Fetch all items that can be insured.
BStringVector insuranceList;
this->getUninsuredItems(playerObject, &insuranceList);
if (gWorldConfig->isTutorial())
{
// We do a simpleified version of insurance when using the terminal in the Tutorial.
if (this->getParentId() && gWorldManager->getObjectById(this->getParentId())->getParentId())
{
// We are located inside a building.
// Insure all insurable items.
if (mSortedInsuranceList.size() == 0)
{
// You do not have any items that can be insured. BUT.. we ignore this for now when running the tutorial.
// gMessageLib->sendSystemMessage(playerObject, L"", "terminal_ui", "no_insurable_items");
}
else
{
// Insure all the items.
// Let's warn about the fatal error conditions first (object destroyed or invalid type),
SortedInventoryItemList::iterator it = mSortedInsuranceList.begin();
while (it != mSortedInsuranceList.end())
{
string selectedItemm = (*it).first;
selectedItemm.convert(BSTRType_Unicode16);
Object* object = gWorldManager->getObjectById((*it).second);
if (!object)
{
// Invalid object, we send a warning about this error.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "insure_fail");
}
else
{
TangibleObject* tangibleObject = dynamic_cast<TangibleObject*>(object);
if (!tangibleObject)
{
// Not a tangible object, we send a warning about this error.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "insure_fail");
}
else if (!tangibleObject->hasInternalAttribute("insured"))
{
// This is not a fatal error, but should never happen.
// [Insurance] Item uninsurable: %TT.
gMessageLib->sendSystemMessage(playerObject,L"","error_message","prose_item_uninsurable", "","", L"", 0, "", "", selectedItemm);
}
else if (tangibleObject->getInternalAttribute<bool>("insured"))
{
// This is not a fatal error, but should never happen.
// [Insurance] Item already insured: %TT.
gMessageLib->sendSystemMessage(playerObject,L"","error_message","prose_item_already_insured", "","", L"", 0, "", "", selectedItemm);
}
else
{
// Update attribute.
tangibleObject->setInternalAttribute("insured","1");
gWorldManager->getDatabase()->ExecuteSqlAsync(NULL,NULL,"UPDATE item_attributes SET value=1 WHERE item_id=%"PRIu64" AND attribute_id=%u",tangibleObject->getId(), 1270);
tangibleObject->setTypeOptions(tangibleObject->getTypeOptions() | 4);
// Update insurance status.
(void)gMessageLib->sendUpdateTypeOption(tangibleObject, playerObject);
}
}
it++;
}
}
// Always display success when doing the tutorial.
// Insurance transaction successfully completed.
gMessageLib->sendSystemMessage(playerObject,L"","base_player","insure_success");
// Inform Tutorial about the insurance.
playerObject->getTutorial()->tutorialResponse("insureItemsDone");
}
}
else
{
switch(messageType)
{
case radId_itemUse:
{
if (playerObject->getNewPlayerExemptions())
{
// player have free deatchs left.
gUIManager->createNewMessageBox(this,"","@base_player:noob_confirm_insure_title","@base_player:noob_confirm_insure_prompt",playerObject, SUI_Window_Insurance_Newbie_MessageBox, SUI_MB_YESNO);
}
else
{
// We should display all uninsured items that can be insured, and that are wearing or carrying in our inventory.
//.........这里部分代码省略.........
示例2: handleObjectMenuSelect
void ElevatorTerminal::handleObjectMenuSelect(uint8 messageType,Object* srcObject)
{
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(srcObject);
if(!playerObject || !playerObject->isConnected() || playerObject->getSamplingState() || playerObject->isIncapacitated() || playerObject->isDead())
{
return;
}
if(messageType == radId_elevatorUp)
{
gMessageLib->sendPlayClientEffectObjectMessage(gWorldManager->getClientEffect(mEffectUp),"",playerObject);
// remove player from current position, elevators can only be inside
CellObject* cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(playerObject->getParentId()));
if(cell)
{
cell->removeObject(playerObject);
}
else
{
gLogger->logMsgF("could not find cell %"PRIu64"",MSG_HIGH,playerObject->getParentId());
}
// put him into new one
playerObject->mDirection = mDstDirUp;
playerObject->mPosition = mDstPosUp;
playerObject->setParentId(mDstCellUp);
cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(mDstCellUp));
if(cell)
{
cell->addObjectSecure(playerObject);
}
else
{
gLogger->logMsgF("could not find cell %"PRIu64"",MSG_HIGH,mDstCellUp);
}
gMessageLib->sendDataTransformWithParent(playerObject);
}
else if(messageType == radId_elevatorDown)
{
gMessageLib->sendPlayClientEffectObjectMessage(gWorldManager->getClientEffect(mEffectDown),"",playerObject);
// remove player from current position, elevators can only be inside
CellObject* cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(playerObject->getParentId()));
if(cell)
{
cell->removeObject(playerObject);
}
else
{
gLogger->logMsgF("could not find cell %"PRIu64"",MSG_HIGH,playerObject->getParentId());
}
// put him into new one
playerObject->mDirection = mDstDirDown;
playerObject->mPosition = mDstPosDown;
playerObject->setParentId(mDstCellDown);
cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(mDstCellDown));
if(cell)
{
cell->addObjectSecure(playerObject);
}
else
{
gLogger->logMsgF("could not find cell %"PRIu64"",MSG_HIGH,mDstCellDown);
}
gMessageLib->sendDataTransformWithParent(playerObject);
}
else
{
gLogger->logMsgF("ElevatorTerminal: Unhandled MenuSelect: %u",MSG_HIGH,messageType);
}
}
示例3: handleUIEvent
void InsuranceTerminal::handleUIEvent(uint32 action,int32 element,string inputStr,UIWindow* window)
{
// gLogger->logMsgF("InsuranceTerminal::handleUIEvent You are here!",MSG_NORMAL);
if(window == NULL)
{
return;
}
PlayerObject* playerObject = window->getOwner(); // window owner
if(playerObject == NULL || !playerObject->isConnected() || playerObject->getSamplingState() || playerObject->isIncapacitated() || playerObject->isDead()|| playerObject->checkState(CreatureState_Combat))
{
return;
}
switch(window->getWindowType())
{
case SUI_Window_Insurance_Newbie_MessageBox: // Tried to insure item when still having free rounds left.
{
switch(action)
{
case 0: // Yes
{
// Player selected to continue with insurance of item even if no need for.
// gLogger->logMsgF("SUI_Window_Insurance_Newbie_MessageBox Yes",MSG_NORMAL);
// Build the items list and optional use error-messages if needed.
BStringVector insuranceList;
this->getUninsuredItems(playerObject, &insuranceList);
// We should display all uninsured items that can be insured, and that are wearing or carrying in our inventory.
// Items in backpackage or in other containers within our inventory shall also be handled.
gUIManager->createNewListBox(this,"insure","@sui:mnu_insure","Select an item to insure.",insuranceList,playerObject,SUI_Window_Insurance_ListBox, SUI_MB_OKCANCEL);
}
break;
case 1: // No
{
// Player selected to abort, since all items are still treated as insured.
// gLogger->logMsgF("SUI_Window_Insurance_Newbie_MessageBox No",MSG_NORMAL);
}
break;
default:
{
gLogger->logMsgF("SUI_Window_Insurance_Newbie_MessageBox Invalid selection!",MSG_NORMAL);
}
break;
}
}
break;
case SUI_Window_Insurance_ListBox:
{
switch (action)
{
case 0: // OK
{
// Insure one item.
// gLogger->logMsgF("SUI_Window_Insurance_ListBox OK",MSG_NORMAL);
Inventory* inventoryObject = dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory));
Bank* bankObject = dynamic_cast<Bank*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Bank));
if(!inventoryObject || !bankObject)
return;
int32 creditsInInventory = inventoryObject->getCredits();
int32 creditsAtBank = bankObject->getCredits();
if (mSortedInsuranceList.size() == 0)
{
// You have no insurable items.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "no_insurables");
}
else if (element > (int32)mSortedInsuranceList.size() - 1 || element < 0)
{
// Unable to process insure item request.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "bad_insure_request");
}
else
{
string selectedItemm((mSortedInsuranceList.at(element).first).getAnsi());
selectedItemm.convert(BSTRType_Unicode16);
Object* object = gWorldManager->getObjectById(mSortedInsuranceList.at(element).second);
if (!object)
{
// Invalid object.
// Insure attempt failed.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "insure_fail");
break;
}
TangibleObject* tangibleObject = dynamic_cast<TangibleObject*>(object);
if (!tangibleObject)
{
// Not a tangible object.
// Insure attempt failed.
gMessageLib->sendSystemMessage(playerObject, L"", "error_message", "insure_fail");
//.........这里部分代码省略.........
示例4: _handleGetAttributesBatch
void ObjectController::_handleGetAttributesBatch(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(mObject);
BString requestStr;
BStringVector dataElements;
BStringVector dataElements2;
uint16 elementCount;
message->getStringUnicode16(requestStr);
requestStr.convert(BSTRType_ANSI);
requestStr.getRawData()[requestStr.getLength()] = 0;
elementCount = requestStr.split(dataElements,' ');
if(!elementCount)
{
return;
}
Message* newMessage;
for(uint16 i = 0; i < elementCount; i++)
{
uint64 itemId = boost::lexical_cast<uint64>(dataElements[i].getAnsi());
Object* object = gWorldManager->getObjectById(itemId);
if(object == NULL)
{
// could be a resource
Resource* resource = gResourceManager->getResourceById(itemId);
if(resource != NULL)
{
resource->sendAttributes(playerObject);
continue;
}
//could be a schematic!
Datapad* datapad = playerObject->getDataPad();
ManufacturingSchematic* schem = datapad->getManufacturingSchematicById(itemId);
if(schem != NULL)
{
schem->sendAttributes(playerObject);
continue;
}
MissionObject* mission = datapad->getMissionById(itemId);
if(mission != NULL)
{
mission->sendAttributes(playerObject);
continue;
}
IntangibleObject* data = datapad->getDataById(itemId);
if(data != NULL)
{
data->sendAttributes(playerObject);
continue;
}
// TODO: check our datapad items
if(playerObject->isConnected())
{
// default reply for schematics
gMessageFactory->StartMessage();
gMessageFactory->addUint32(opAttributeListMessage);
gMessageFactory->addUint64(itemId);
gMessageFactory->addUint32(0);
//gMessageFactory->addUint16(0);
//gMessageFactory->addUint32(40);
newMessage = gMessageFactory->EndMessage();
(playerObject->getClient())->SendChannelAUnreliable(newMessage, playerObject->getAccountId(), CR_Client, 8);
}
//finally, when we are crafting this could be the new item, not yet added to the worldmanager??
if(playerObject->getCraftingSession())
{
if(playerObject->getCraftingSession()->getItem()&&playerObject->getCraftingSession()->getItem()->getId() == itemId)
{
playerObject->getCraftingSession()->getItem()->sendAttributes(playerObject);
}
}
}
else
{
// Tutorial: I (Eru) have to do some hacks here, since I don't know how to get the info of what object the client has selected (by single click) in the Inventory.
if (gWorldConfig->isTutorial())
{
// Let's see if the actual object is the food item "Melon" in our inventory.
if (dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory))->getId() == object->getParentId())
{
//uint64 id = object->getId();
// Is it an Item?
Item* item = dynamic_cast<Item*>(object);
//.........这里部分代码省略.........
示例5: _handlePurchaseTicket
void ObjectController::_handlePurchaseTicket(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(mObject);
BString dataStr;
BStringVector dataElements;
uint16 elements;
float purchaseRange = gWorldConfig->getConfiguration<float>("Player_TicketTerminalAccess_Distance",(float)10.0);
if(playerObject->states.getPosture() == CreaturePosture_SkillAnimating)
{
gMessageLib->SendSystemMessage(::common::OutOfBand("error_message", "wrong_state"), playerObject);
return;
}
//however we are able to use the purchaseticket command in starports
//without having to use a ticketvendor by just giving commandline parameters
//when we are *near* a ticket vendor
TravelTerminal* terminal = dynamic_cast<TravelTerminal*> (gWorldManager->getNearestTerminal(playerObject,TanType_TravelTerminal));
// iterate through the results
if((!terminal)|| (glm::distance(terminal->mPosition, playerObject->mPosition) > purchaseRange))
{
gMessageLib->SendSystemMessage(::common::OutOfBand("travel", "too_far"), playerObject);
return;
}
playerObject->setTravelPoint(terminal);
message->getStringUnicode16(dataStr);
// Have to convert BEFORE using split, since the conversion done there is removed It will assert().. evil grin...
// Either do the conversion HERE, or better fix the split so it handles unicoe also.
dataStr.convert(BSTRType_ANSI);
elements = dataStr.split(dataElements,' ');
if(elements < 4)
{
gMessageLib->SendSystemMessage(::common::OutOfBand("travel", "route_not_available"), playerObject);
return;
}
// get price and planet ids
TicketProperties ticketProperties;
gTravelMapHandler->getTicketInformation(dataElements,&ticketProperties);
if(!ticketProperties.dstPoint)
{
gMessageLib->SendSystemMessage(::common::OutOfBand("travel", "route_not_available"), playerObject);
return;
}
uint8 roundTrip = 0;
if(elements > 4)
roundTrip = atoi(dataElements[4].getAnsi());
if(dataElements[4].getCrc() == BString("single").getCrc())
roundTrip = 0;
//how many tickets will it be?
uint32 amount = 1;
if(roundTrip)
amount = 2;
Inventory* inventory = dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory));
Bank* bank = dynamic_cast<Bank*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Bank));
if(!inventory->checkSlots(static_cast<uint8>(amount)))
{
gMessageLib->SendSystemMessage(::common::OutOfBand("error_message", "inv_full"), playerObject);
return;
}
if(roundTrip == 1)
{
ticketProperties.price *= 2;
}
// update bank or inventory credits
if(!(inventory->updateCredits(-ticketProperties.price)))
{
if(!(bank->updateCredits(-ticketProperties.price)))
{
//gMessageLib->sendSystemMessage(entertainer,L"","travel","route_not_available");
gUIManager->createNewMessageBox(NULL,"ticketPurchaseFailed","The Galactic Travel Commission","You do not have enough money to complete the ticket purchase.",playerObject);
return;
}
}
if(playerObject->isConnected())
{
gMessageLib->SendSystemMessage(::common::OutOfBand("base_player", "prose_pay_acct_success", "", "", "", "", "money/acct_n", "travelsystem", ticketProperties.price), playerObject);
gObjectFactory->requestNewTravelTicket(inventory,ticketProperties,inventory->getId(),99);
//.........这里部分代码省略.........
示例6: handleObjectMenuRequest
void ObjectController::handleObjectMenuRequest(Message* message)
{
//for ever item where we request a radial the client starts by displaying a radial on his own and additionally sends a
//objectMenuRequest to the server
//The server then either just resends the radial as send by the client or adds / modifies options on his own
//this is why sometimes when lag is involved it takes some time for all options to display
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(mObject);
message->getUint32(); // unknown
uint64 requestedObjectId = message->getUint64();
message->getUint64(); // player id again ?
Object* requestedObject = gWorldManager->getObjectById(requestedObjectId);
uint32 itemCount = message->getUint32();
BString extendedDescription;
MenuItemList menuItemList;
MenuItem* menuItem;
for(uint32 i = 0; i < itemCount; i++)
{
menuItem = new(MenuItem);
menuItem->sItem = message->getUint8(); // item nr
menuItem->sSubMenu = message->getUint8(); // submenu flag
menuItem->sIdentifier = message->getUint8(); // item identifier
menuItem->sOption = message->getUint8(); // extended option
message->getStringUnicode16(extendedDescription);
menuItemList.push_back(menuItem);
}
uint8 responseNr = message->getUint8();
if(!requestedObject)
{
if(playerObject->isConnected())
gMessageLib->sendEmptyObjectMenuResponse(requestedObjectId,playerObject,responseNr,menuItemList);
//the list is cleared and items are destroyed in the message lib
//for the default response
return;
}
requestedObject->setMenuList(&menuItemList);
//are we an item dropped in a structure awaiting to be moved or picked u`p?
//just implement this virtual function for items as we need just one central point instead
//of the same code over and over for all items
CellObject* itemCell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(requestedObject->getParentId()));
Item* item = dynamic_cast<Item*>(requestedObject);
ResourceContainer* rC = dynamic_cast<ResourceContainer*>(requestedObject);
TangibleObject* tO = dynamic_cast<TangibleObject*>(requestedObject);
//only display that menu when *we* and the item are in the same structure
if((rC || item) && itemCell && (!tO->getStatic()))
{
CellObject* playerCell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(playerObject->getParentId()));
if(playerCell && (playerCell->getParentId() == itemCell->getParentId()))
{
PlayerStructure* pS = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(playerCell->getParentId()));
if(pS)
requestedObject->prepareCustomRadialMenuInCell(playerObject,static_cast<uint8>(itemCount));
}
}
/*
if(rc && requestedObject->getParentId())
{
if(CellObject* cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(requestedObject->getParentId())))
{
requestedObject->prepareCustomRadialMenuInCell(playerObject,static_cast<uint8>(itemCount));
}
}
*/
//delete the radials after every use or provide every object with set rules when to delete it ?
if(!requestedObject->getRadialMenu())
requestedObject->prepareCustomRadialMenu(playerObject,static_cast<uint8>(itemCount));
if (requestedObject->getRadialMenu())
{
if(playerObject->isConnected())
{
gMessageLib->sendObjectMenuResponse(requestedObject,playerObject,responseNr);
}
//they only reset if the objects virtual function does it
//by default it stays
requestedObject->ResetRadialMenu();
//the radial menu is supposed to be an intelligent pointer deleting itself when no reference is left
//however during runtime the item always references the radialmenu that was generated for it on the first call.
//when the circumstances of the item change we need to delete the pointer and thus force it to generate a new radial
}
else
{
//.........这里部分代码省略.........
示例7: _processTravelPointListRequest
void TravelMapHandler::_processTravelPointListRequest(Message* message,DispatchClient* client)
{
PlayerObject* playerObject = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(message->getUint64()));
if(playerObject != NULL && playerObject->isConnected())
{
// we need to know where we query from
TravelTerminal* terminal = playerObject->getTravelPoint();
if(terminal == NULL)
{
DLOG(INFO) << "TravelMapHandler::_processTravelListRequest: No TravelPosition set, player "<<playerObject->getId();
return;
}
BString requestedPlanet;
message->getStringAnsi(requestedPlanet);
// find our planetId
uint8 planetId = gWorldManager->getPlanetIdByName(requestedPlanet);
char queryPoint[64];
TravelPoint* qP = NULL;
// get our query point
strcpy(queryPoint,(playerObject->getTravelPoint())->getPosDescriptor().getAnsi());
TravelPointList::iterator it = mTravelPoints[mZoneId].begin();
TravelPointList::iterator end = mTravelPoints[mZoneId].end();
while(it != end)
{
TravelPoint* tp = (*it);
if(strcmp(queryPoint,tp->descriptor) == 0)
{
qP = tp;
break;
}
++it;
}
TravelPointList printListing;
it = mTravelPoints[planetId].begin();
end = mTravelPoints[planetId].end();
while(it != end)
{
// If the requested planet list is not the planet of the current zone
// then only list it if the origin is a starport and the destination is a starport.
if((mZoneId != planetId && qP->portType == 1 && (*it)->portType == 1) ||
mZoneId == planetId) // Show all starports/shuttleports on this planet.
{
printListing.push_back((*it));
}
++it;
}
//Build our message.
gMessageFactory->StartMessage();
gMessageFactory->addUint32(opPlanetTravelPointListResponse);
gMessageFactory->addString(requestedPlanet);
end = printListing.end();
gMessageFactory->addUint32(printListing.size());
for(it = printListing.begin(); it != end; ++it)
{
gMessageFactory->addString((*it)->descriptor);
}
gMessageFactory->addUint32(printListing.size());
for(it = printListing.begin(); it != end; ++it)
{
gMessageFactory->addFloat((*it)->x);
gMessageFactory->addFloat((*it)->y);
gMessageFactory->addFloat((*it)->z);
}
gMessageFactory->addUint32(printListing.size());
for(it = printListing.begin(); it != end; ++it)
{
gMessageFactory->addUint32((*it)->taxes);
}
gMessageFactory->addUint32(printListing.size());
for(it = printListing.begin(); it != end; ++it)
{
// If it's a starport send a 1, otherwise shuttleports are set to 0
if ((*it)->portType == portType_Starport) {
gMessageFactory->addUint8(1);
} else {
gMessageFactory->addUint8(0);
}
}
playerObject->getClient()->SendChannelA(gMessageFactory->EndMessage(), playerObject->getAccountId(), CR_Client, 5);
}
else
DLOG(INFO) << "TravelMapHandler::_processTravelListRequest: Couldnt find player for " << client->getAccountId();
}
示例8: _handleAddFriend
void ObjectController::_handleAddFriend(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
PlayerObject* player = dynamic_cast<PlayerObject*>(mObject);
if(player->getContactListUpdatePending())
return;
else
player->setContactListUpdatePending(true);
string friendName;
int8 sql[1024],end[16],*sqlPointer;
message->getStringUnicode16(friendName);
friendName.convert(BSTRType_ANSI);
if(!friendName.getLength())
{
player->setContactListUpdatePending(false);
return;
}
if(player->isConnected())
gMessageLib->sendHeartBeat(player->getClient());
friendName.toLower();
// check if he's already our friend
if(player->checkFriendList(friendName.getCrc()))
{
friendName.convert(BSTRType_Unicode16);
gMessageLib->sendSystemMessage(player,L"","cmnty","friend_duplicate","","",L"",0,"","",friendName.getUnicode16());
player->setContactListUpdatePending(false);
return;
}
// or ignored
if(player->checkIgnoreList(friendName.getCrc()))
{
friendName.convert(BSTRType_Unicode16);
gMessageLib->sendSystemMessage(player,L"","cmnty","friend_fail_is_ignored","","",L"",0,"","",friendName.getUnicode16());
player->setContactListUpdatePending(false);
return;
}
// check our own name
string firstName = player->getFirstName().getAnsi();
firstName.toLower();
if(strcmp(firstName.getAnsi(),friendName.getAnsi()) == 0)
{
player->setContactListUpdatePending(false);
return;
}
// pull the db query
ObjControllerAsyncContainer* asyncContainer = new(mDBAsyncContainerPool.malloc()) ObjControllerAsyncContainer(OCQuery_AddFriend);
asyncContainer->mString = friendName.getAnsi();
sprintf(sql,"SELECT sf_addFriend(%"PRIu64",'",player->getId());
sprintf(end,"')");
sqlPointer = sql + strlen(sql);
sqlPointer += mDatabase->Escape_String(sqlPointer,friendName.getAnsi(),friendName.getLength());
strcat(sql,end);
mDatabase->ExecuteSqlAsync(this,asyncContainer,sql);
}