Nobility problem, InfamousNoone Source.

05/24/2013 02:46 LordGragen.#1
hey guys since my collage classes are starting i need to start getting into more coding and learning stuff so i got InfamousNoone source and it was prty dam good source,

i have been fixing few bugs today garment,guard etc but i got this 1 problem i cannot figure out,

the nobility icon, i know the nobility work i can see the prince in my acc etc but i cannot see the nobility icon at the top so i can donate more or others.

and idk if i am correct or not but i think porblem is comming from here.

Code:
 public static implicit operator byte[](NobilityRankPacket packet)
        {
            int strings_length = 0;
            string[] strings = new string[packet.Ranks.Length];
            for (int i = 0; i < packet.Ranks.Length; i++)
            {
                if (packet.Type == NobilityRankType.Icon)
                    strings[i] = packet.Ranks[i].LocalString;
                else if (packet.Type == NobilityRankType.Listings)
                    strings[i] = packet.Ranks[i].ListingString;
                strings_length += strings[i].Length;
            }
            byte[] data = new byte[33 + strings_length + 8];
            fixed (byte* pData = data)
            {
                FormatHead(pData, data.Length - 8, packet.Type);
                *((uint*)(pData + 8)) = packet.Value;
                FormatStrings(pData, 28, strings);
                PacketBuilder.AppendTQServer(pData, data.Length);
            }
            return data;
        }
here is the full code about nobility but like i said i think the problem is from top and any kind of help will be nice.

Nobility.cs
Nobility rank
Rankings
Donate
05/24/2013 03:18 _DreadNought_#2
Do you know what "implicit operator byte[]" does? If not that's a great place to start. :)
05/24/2013 03:22 LordGragen.#3
Quote:
Originally Posted by _DreadNought_ View Post
Do you know what "implicit operator byte[]" does? If not that's a great place to start. :)
found this but no time to read atm
[Only registered and activated users can see links. Click Here To Register...]

got class to teach after i am back i will read it, thx
05/24/2013 03:45 Super Aids#4
Basically an operator overload of implicit conversions.

Which means you can convert a type implicit into another type. This is different from explicit conversion where you need to specify the type.

Ex: (implicit)
Code:
sbyte signed_byte = 0;
short signed_int16 = signed_byte;
Ex: (explicit)
Code:
short signed_int16 = 0;
sbyte signed_byte = (sbyte)signed_int16 ;
In this case it's an overload of converting NobilityRank (class) into a byte array (byte[])
So you could do:
Code:
NobilityRank rank = new NobilityRank();
// rank.x
// ...
byte[] Packet = rank; // instead of ex. rank.ToArray();
05/24/2013 10:31 InfamousNoone#5
the packet has changed since then afaik
05/24/2013 12:43 Super Aids#6
Hybrid, I send him mine and it should work, unless it has changed since 5520+
05/24/2013 22:09 LordGragen.#7
i remember that nobility changed, but not sure from what version it was.