Guild Name

06/21/2012 03:54 shadowman123#1
Well once i login if any player in my screen in guild ..it doesnt show me his guild name whats the problem ?

[Only registered and activated users can see links. Click Here To Register...]
06/21/2012 03:56 Zeroxelli#2
You have to send the guild data packet for that guild ID first.
06/21/2012 04:05 shadowman123#3
Quote:
Originally Posted by Zeroxelli View Post
You have to send the guild data packet for that guild ID first.
Guild Data packet ?? Do u mean packet 1106 ?
06/21/2012 05:17 Zeroxelli#4
Quote:
Originally Posted by shadowman123 View Post
Guild Data packet ?? Do u mean packet 1106 ?
Yes. And if I remember right, you also have to send a string packet corresponding to whether the guild is neutral, enemy, or ally. If you don't do that, the client won't know what color to make the name.

Edit: You send the ally/enemy info on login. Here's what I sent when a character logged on in my old 4274 source (might be buggy..)

Code:
        public static void SendGuildInfo(EndClient Client)
        {
            if (Client.Char.Guild == 0)
            {
                Client.Send(GamePackets.Guild(Client));
                return;
            }
            if (Pool.ContainsKey(Client.Char.Guild))
            {
                Guild MyGuild = Pool[Client.Char.Guild];
                Client.Send(GamePackets.Guild(Client));
                Client.Send(GamePackets.String(MyGuild.GuildID, MyGuild.Name, (int)StringType.GuildName));
                Client.Send(GamePackets.Chat(Convert.ToString(MyGuild.GuildID), Client.Char.Name, MyGuild.Bulletin, 0, ChatType.GuildBulletin));

                foreach (Guild G in Pool.Values)
                {
                    if (G.GuildID != Client.Char.Guild)
                    {
                        Client.Send(GamePackets.GuildData(GuildType.Neutral, G.GuildID));

                        if (MyGuild.EnemyList.Contains(G.GuildID))
                        {
                            Guild EnemyGuild = Pool[G.GuildID];
                            Client.Send(GamePackets.String(G.GuildID, EnemyGuild.Name, (int)StringType.GuildEnemies));
                            Client.Send(GamePackets.GuildData(GuildType.Enemied, G.GuildID));
                        }

                        if (MyGuild.AllyList.Contains(G.GuildID))
                        {
                            Guild AllyGuild = Pool[G.GuildID];
                            Client.Send(GamePackets.String(G.GuildID, AllyGuild.Name, (int)StringType.GuildAllies));
                            Client.Send(GamePackets.GuildData(GuildType.Allied, G.GuildID));
                        }
                    }
                }
            }
        }
Edit: Also, obviously, it would have been better to loop through the ally list and enemy list instead of the whole pool, but I wasn't too bright back then. ;)