예제 #1
0
            static bool OnGuildDelRank(LoginClient client, CMSG msgID, BinReader data)
            {
                DBGuild tguild = client.Character.Guild;

                if (tguild == null || client.Character.GuildID == 0)
                {
                    SendResult(client, 2, " ", (int)GUILDRESULT.NOT_IN_GUILD);
                    return(true);
                }
                bool inuse = false;

                foreach (DBGuildMembers member in tguild.Members)
                {
                    if (member.Rank == tguild.MaxRank)
                    {
                        inuse = true;
                    }
                }
                if (inuse)
                {
                    SendResult(client, 3, " ", (int)GUILDRESULT.NOT_IN_GUILD);
                    return(true);
                }

                tguild.setRankName(tguild.MaxRank, "Unused");
                tguild.MaxRank--;
                DataServer.Database.SaveObject(tguild);
                UpdateGuild(client);
                SendRoster(client, tguild);
                return(true);
            }             //OnGuildDelRank
예제 #2
0
            static bool OnGuildRank(LoginClient client, CMSG msgID, BinReader data)
            {
                uint    rank      = data.ReadUInt32();
                uint    rankflags = data.ReadUInt32();
                string  rankname  = data.ReadString();
                DBGuild guild     = client.Character.Guild;

                guild.setRankName(rank, rankname);
                guild.setRankFlags(rank, rankflags);
                DataServer.Database.SaveObject(guild);
                UpdateGuild(client);
                SendRoster(client, guild);
                return(true);
            }            //OnGuildRank
예제 #3
0
            static bool OnGuildAddRank(LoginClient client, CMSG msgID, BinReader data)
            {
                DBGuild tguild = client.Character.Guild;

                if (tguild == null || client.Character.GuildID == 0)
                {
                    SendResult(client, 2, " ", (int)GUILDRESULT.NOT_IN_GUILD);
                    return(true);
                }
                tguild.MaxRank++;
                tguild.setRankName(tguild.MaxRank, data.ReadString());
                DataServer.Database.SaveObject(tguild);
                UpdateGuild(client);
                SendRoster(client, tguild);
                return(true);
            }             //OnGuildAddRank