public static void Handle(Entities.GameClient client, GuildPacket guild)
 {
     if (client.Guild != null)
     {
         client.SendGuild();
         using (var announce = new Packets.GuildPacket(new Packets.StringPacker(client.Guild.Bullentin)))
         {
             announce.Data = Core.Kernel.TimeGet(Enums.TimeType.Day);
             announce.Action = Enums.GuildAction.SetAnnounce;
             client.Send(announce);
         }
     }
 }
Exemplo n.º 2
0
        public static bool Create(Entities.GameClient leader, string Name)
        {
            if (Database.GuildDatabase.Create(leader, Name))
            {
                leader.SendGuild();
                leader.Screen.FullUpdate();
                leader.GuildMemberInfo.Index = 0;

                using (var msg =Packets.Message.MessageCore.CreateSystem("ALL",
                                                                         string.Format(Core.MessageConst.NEW_GUILD, Name, leader.Name)))
                {
                    Packets.Message.MessageCore.SendGlobalMessage(msg);
                }
                return true;
            }
            return false;
        }
Exemplo n.º 3
0
        public void DonateCPs(Entities.GameClient client, uint Amount)
        {
            if (client.CPs >= Amount)
            {
                client.CPs -= Amount;
                CPDonation += Amount;
                client.GuildMemberInfo.CPDonation += Amount;
                Database.GuildDatabase.UpdateGuildInfo(this, "GuildCPsFund", CPDonation);
                Database.CharacterDatabase.Save(client);
                client.SendGuild();

                SendMessage(string.Format(Core.MessageConst.GUILD_DONATE, client.Name, Amount, "CPs"));
            }
        }
Exemplo n.º 4
0
        public void DonateMoney(Entities.GameClient client, uint Amount)
        {
            if (client.Money >= Amount)
            {
                client.Money -= Amount;
                MoneyDonation += Amount;
                client.GuildMemberInfo.MoneyDonation += Amount;
                Database.GuildDatabase.UpdateGuildInfo(this, "GuildFund", MoneyDonation);
                Database.CharacterDatabase.Save(client);
                client.SendGuild();

                SendMessage(string.Format(Core.MessageConst.GUILD_DONATE, client.Name, Amount, "Silvers"));
            }
        }
Exemplo n.º 5
0
        public void AddMember(Entities.GameClient client)
        {
            if (Members.Contains(client.DatabaseUID))
                client.GuildMemberInfo = Members[client.DatabaseUID];
            else
            {
                client.GuildMemberInfo = new GuildMember(client);
                if (Members.TryAdd(client.DatabaseUID, client.Name, client.GuildMemberInfo))
                {
                    client.Guild = this;

                    SendMessage(string.Format(Core.MessageConst.NEW_MEMBER, client.Name));
                }
                else
                    client.GuildMemberInfo = null;

                Database.CharacterDatabase.Save(client);
            }

            ReorderIndex();
            client.SendGuild();
            client.Screen.FullUpdate();
        }