Пример #1
0
        public static void DecodeGuilds(MaplePacket pPacket, byte pWorldID)
        {
            pWorldID = GameHelper.GetAllianceWorldID(pWorldID);

            int guilds = pPacket.ReadInt();
            for (int i = 0; i < guilds; i++)
            {
                Guild guild = new Guild();
                guild.Decode(pPacket);
                guild.Save(pWorldID);
            }
        }
Пример #2
0
        public virtual void HandleGuild(ClientConnection pConnection, MaplePacket pPacket)
        {
            byte type = pPacket.ReadByte();
            if (type == 0x20)
            {
                bool hasGuild = pPacket.ReadBool();
                if (hasGuild)
                {
                    Guild guild = new Guild();
                    guild.Decode(pPacket);
                    guild.Save(pConnection.WorldID);

                    pConnection.Logger_WriteLine("{0} must be in Guild {1}", pConnection.LastLoggedCharacterName, guild.Name);
                }
                else
                {
                    // Not in a guild, anymore?
                    MySQL_Connection.Instance.RunQuery("DELETE FROM guild_members WHERE character_id = " + pConnection.CharacterInternalID + " AND world_id = " + GameHelper.GetAllianceWorldID(pConnection.WorldID));
                }
            }
        }