Jump to content
  • Decypher and cleanup the "PlayerBytes" used by the core and database


    madmax
    • Status: accepted
      Main Category: Core / Mangos Daemon
      Sub-Category: Code Enhancement
      Version: 21.0 Milestone: 21 (Current) Priority: Normal
      Related to:
      Implemented Version: 0.20

    Currently Character info is stored in "PlayerBytes" and should be rewritten to make sense

    In the Characters table of all cores we currently save individual character information (like skin colour, hair etc) in the Playerbytes fields.

    We need to decypher how these Playerbytes are decided and come up with a better system to store them more readable.

    Such a system would need to be applied to all cores, starting with zero.



    User Feedback

    Recommended Comments

    Well, from looking at Player.cpp in Mangos two, the fields seem to be organized as
    [quote]
    uint32 playerBytes = .. (fetch playerBytes1) ..
    skin = uint8(playerBytes);
    face = uint8(playerBytes >> 8);
    hair style = uint8(playerBytes >> 16);
    hair color = uint8(playerBytes >> 24);

    uint32 playerBytes2 = .. (fetch playerBytes2) ..
    facial hair = uint8(playerBytes2 & 0xFF);
    [/quote]

    Since mangos handles data in little endian format, we can just split the first player bytes column into four separate ones for skin color, face, hair style and hair color. With the second column I'm not sure whether or not anything other than facial hair is stored there but if so it shouldn't take too long to find out what those bytes are used for.

    I can take care of this when I have spare time (not sure how long that will be), but if anyone would like to take a stab at this it shouldn't be hard.
    For instance, one of my characters has the following data in playerBytes(1):
    50725129
    All we would need to do is convert this into 50, 72, 51 and 29 for the four new fields and then reflect the minor change in the core.

    Edit: if it's just a matter of figuring out how this data is taken from the client, I should be able to figure that out in the next day or so.

    Share this comment


    Link to comment
    Share on other sites

    Would you mind looking into this on Zero and if possible One as well?

    If we can figure that out it will make migrations script between the cores much easier.

    Share this comment


    Link to comment
    Share on other sites


    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use