• 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!

C++ Server respect outfits.xml

potinho

Intermediate OT User
Joined
Oct 11, 2009
Messages
1,397
Solutions
17
Reaction score
148
Location
Brazil
Hello everyone, I have an OTX 2 server (TFS 0.3.7) 7.72 protocol, where I define the outfits range in the sources, as below in protocolgame.cpp:
Im using OTCv8 as client.

C++:
void ProtocolGame::sendOutfitWindow()
{
    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0xC8);
    AddCreatureOutfit(msg, player, player->getDefaultOutfit(), true);

    #ifdef _MULTIPLATFORM77
    msg->put<uint16_t>(player->sex % 2 ? 291 : 306); //start male and female
    msg->put<uint16_t>(player->isPremium() ? (player->sex % 2 ? 305 : 320) : (player->sex % 2 ? 299 : 313)); //first, premium ends male and female, second no premium ends male and female
    #else
    msg->put<char>(player->sex % 2 ? 291 : 306);//start male and female
    msg->put<char>(player->isPremium() ? (player->sex % 2 ? 305 : 320) : (player->sex % 2 ? 299 : 313));//first, premium ends male and female, second no premium ends male and female
    #endif

    player->hasRequestedOutfit(true);
}

But my server came with outfits.xml, except that no changes I make there are reflected in the game. How to make my server consider outfits.xml?

XML:
<?xml version="1.0"?>
<outfits>
    <outfit id="1">
        <list gender="0" lookType="136" name="Citizen"/>
        <list gender="1" lookType="128" name="Citizen"/>
    </outfit>

    <outfit id="2">
        <list gender="0" lookType="137" name="Hunter"/>
        <list gender="1" lookType="129" name="Hunter"/>
    </outfit>

    <outfit id="3">
        <list gender="0" lookType="138" name="Mage"/>
        <list gender="1" lookType="130" name="Mage"/>
    </outfit>

    <outfit id="4">
        <list gender="0" lookType="139" name="Knight"/>
        <list gender="1" lookType="131" name="Knight"/>
    </outfit>

    <outfit id="5">
        <list gender="0" lookType="140" name="Noblewoman"/>
        <list gender="1" lookType="132" name="Nobleman"/>
    </outfit>

    <outfit id="6">
        <list gender="0" lookType="141" name="Summoner"/>
        <list gender="1" lookType="133" name="Summoner"/>
    </outfit>

    <outfit id="7">
        <list gender="0" lookType="142" name="Warrior"/>
        <list gender="1" lookType="134" name="Warrior"/>
    </outfit>
 
        <outfit id="8">
        <list gender="0" lookType="318" name="Assassin"/>
        <list gender="1" lookType="303" name="Assassin"/>
    </outfit>
 
</outfits>

Console shows to me outfits are being loaded:
1636040001223.png
 
Last edited:
These are the sources of the engine you say you use: otxserver/sources at otxserv2 · mattyx14/otxserver (https://github.com/mattyx14/otxserver/blob/otxserv2/sources)

So all you have to do is look at the code and see if just copying and pasting works for you, since the sendOutfitWindow method in your example code seems to be deliberately modified to only admit two unique outfits for each sex.

direct link to the method sendOutfitWindow: otxserver/protocolgame.cpp at fb3f3f584b0764ec9db84148e0763d1a5f5cb9d1 · mattyx14/otxserver (https://github.com/mattyx14/otxserver/blob/fb3f3f584b0764ec9db84148e0763d1a5f5cb9d1/sources/protocolgame.cpp#L2517-L2561)
 
These are the sources of the engine you say you use: otxserver/sources at otxserv2 · mattyx14/otxserver (https://github.com/mattyx14/otxserver/blob/otxserv2/sources)

So all you have to do is look at the code and see if just copying and pasting works for you, since the sendOutfitWindow method in your example code seems to be deliberately modified to only admit two unique outfits for each sex.

direct link to the method sendOutfitWindow: otxserver/protocolgame.cpp at fb3f3f584b0764ec9db84148e0763d1a5f5cb9d1 · mattyx14/otxserver (https://github.com/mattyx14/otxserver/blob/fb3f3f584b0764ec9db84148e0763d1a5f5cb9d1/sources/protocolgame.cpp#L2517-L2561)
Just changing code i've got errors when try to compile:

1636040746491.png
Post automatically merged:

in 000-constant.lua i already have

Lua:
maleOutfits = {128, 129, 130, 131, 132, 133, 134, 144}
femaleOutfits = {136, 137, 138, 139, 140, 141, 142, 144}
 
Last edited:
Back
Top