• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Change name store

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
bug:
player buy change name, in the field the player dont write nothing, press ok, done, all bugged because player will be without any name, if login Crash the ot..

this purchase is from store

I think the point is:

C++:
 if (offerType == STORE_OFFERTYPE_NAMECHANGE) {
        param = msg.getString();
    }

protocolgame.cpp
C++:
void ProtocolGame::parseStoreBuyOffer(NetworkMessage& msg)
{
    uint32_t offerId = msg.get<uint32_t>();
    StoreOfferType_t offerType = static_cast<StoreOfferType_t>(msg.getByte());
    std::string param;
 
    if (offerType == STORE_OFFERTYPE_NAMECHANGE) {
        param = msg.getString();
    }

    auto offer = g_store->getOfferById(offerId);
    if (!offer) {
        sendStoreError(STORE_ERROR_PURCHASE, "Offer not found. Please reopen the store and try again.");
        return;
    }

    if ((strcasecmp(offer->getName().c_str(), "name change") == 0) && offerType != STORE_OFFERTYPE_NAMECHANGE) {
        requestPurchaseData(offerId, STORE_OFFERTYPE_NAMECHANGE);
        return;
    }

    addGameTask(&Game::playerPurchaseStoreOffer, player->getID(), offerId, param); 
}

and how to avoid symbols too?

tfs .1.2
 
Back
Top