mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 20:28:21 +00:00
fix one spot I missed
This commit is contained in:
parent
e145d237e4
commit
820d7f7093
@ -118,7 +118,7 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
|
|||||||
// Check if player is online first
|
// Check if player is online first
|
||||||
if (isBestFriendRequest && !requestee) {
|
if (isBestFriendRequest && !requestee) {
|
||||||
for (auto friendDataCandidate : requestor->friends) {
|
for (auto friendDataCandidate : requestor->friends) {
|
||||||
if (friendDataCandidate.friendName == playerName) {
|
if (friendDataCandidate.friendName == playerName.GetAsString()) {
|
||||||
requestee.reset(new PlayerData());
|
requestee.reset(new PlayerData());
|
||||||
// Setup the needed info since you can add a best friend offline.
|
// Setup the needed info since you can add a best friend offline.
|
||||||
requestee->playerID = friendDataCandidate.friendID;
|
requestee->playerID = friendDataCandidate.friendID;
|
||||||
@ -142,11 +142,11 @@ void ChatPacketHandler::HandleFriendRequest(Packet* packet) {
|
|||||||
// Send the response code that corresponds to what the error is.
|
// Send the response code that corresponds to what the error is.
|
||||||
if (!requestee) {
|
if (!requestee) {
|
||||||
std::unique_ptr<sql::PreparedStatement> nameQuery(Database::CreatePreppedStmt("SELECT name from charinfo where name = ?;"));
|
std::unique_ptr<sql::PreparedStatement> nameQuery(Database::CreatePreppedStmt("SELECT name from charinfo where name = ?;"));
|
||||||
nameQuery->setString(1, playerName);
|
nameQuery->setString(1, playerName.GetAsString());
|
||||||
std::unique_ptr<sql::ResultSet> result(nameQuery->executeQuery());
|
std::unique_ptr<sql::ResultSet> result(nameQuery->executeQuery());
|
||||||
|
|
||||||
requestee.reset(new PlayerData());
|
requestee.reset(new PlayerData());
|
||||||
requestee->playerName = playerName;
|
requestee->playerName = playerName.GetAsString();
|
||||||
|
|
||||||
SendFriendResponse(requestor, requestee.get(), result->next() ? eAddFriendResponseType::NOTONLINE : eAddFriendResponseType::INVALIDCHARACTER);
|
SendFriendResponse(requestor, requestee.get(), result->next() ? eAddFriendResponseType::NOTONLINE : eAddFriendResponseType::INVALIDCHARACTER);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user