示例#1
0
 public static void HandleGuildKickRequestMessage(WorldClient client, GuildKickRequestMessage message)
 {
     if (client.Character.Guild != null)
     {
         Stump.Server.WorldServer.Game.Guilds.GuildMember guildMember = client.Character.Guild.TryGetMember((int)message.kickedId);
         if (guildMember != null)
         {
             guildMember.Guild.KickMember(client.Character, guildMember);
         }
     }
 }
示例#2
0
 public static void HandleGuildChangeMemberParametersMessage(WorldClient client, GuildChangeMemberParametersMessage message)
 {
     if (client.Character.Guild != null)
     {
         Stump.Server.WorldServer.Game.Guilds.GuildMember guildMember = client.Character.Guild.TryGetMember((int)message.memberId);
         if (guildMember != null)
         {
             client.Character.Guild.ChangeParameters(client.Character, guildMember, (short)message.rank, (byte)message.experienceGivenPercent, message.rights);
         }
     }
 }
        public static void HandleCharacterDeletionRequestMessage(WorldClient client, CharacterDeletionRequestMessage message)
        {
            if (!IPCAccessor.Instance.IsConnected)
            {
                client.Send(new CharacterDeletionErrorMessage(1));
                client.DisconnectLater(1000);
            }
            else
            {
                CharacterRecord characterRecord = client.Characters.Find((CharacterRecord entry) => entry.Id == message.characterId);
                if (characterRecord == null)
                {
                    client.Send(new CharacterDeletionErrorMessage(1));
                    client.DisconnectLater(1000);
                }
                else
                {
                    Stump.Server.WorldServer.Game.Guilds.GuildMember guildMember = Singleton <GuildManager> .Instance.TryGetGuildMember(characterRecord.Id);

                    if (guildMember != null && guildMember.IsBoss)
                    {
                        client.Send(new CharacterDeletionErrorMessage(1));
                        client.DisconnectLater(1000);
                    }
                    else
                    {
                        string secretAnswerHash = message.secretAnswerHash;
                        if (Singleton <ExperienceManager> .Instance.GetCharacterLevel(characterRecord.Experience) <= 20 || (client.Account.SecretAnswer != null && secretAnswerHash == (message.characterId + "~" + client.Account.SecretAnswer).GetMD5()))
                        {
                            if (client.Account.DeletedCharactersCount > CharacterHandler.MaxDayCharacterDeletion)
                            {
                                client.Send(new CharacterDeletionErrorMessage(2));
                            }
                            else
                            {
                                Singleton <CharacterManager> .Instance.DeleteCharacterOnAccount(characterRecord, client);

                                CharacterHandler.SendCharactersListMessage(client);
                                BasicHandler.SendBasicNoOperationMessage(client);
                            }
                        }
                        else
                        {
                            client.Send(new CharacterDeletionErrorMessage(3));
                        }
                    }
                }
            }
        }
示例#4
0
        public bool RemoveMember(GuildMember member)
        {
            bool result;

            lock (this.m_lock)
            {
                if (member == null || !this.m_members.Contains(member))
                {
                    result = false;
                }
                else
                {
                    this.m_members.Remove(member);
                    if (member.IsConnected)
                    {
                        this.m_clients.Remove(member.Character.Client);
                    }
                    this.OnMemberRemoved(member);
                    result = true;
                }
            }
            return(result);
        }
示例#5
0
文件: Guild.cs 项目: Mixi59/Stump
        public bool TryAddMember(Character character, out GuildMember member)
        {
            if (!CanAddMember())
            {
                member = null;
                return(false);
            }

            member = new GuildMember(this, character);
            m_members.Add(member);
            character.GuildMember = member;

            m_clients.Add(character.Client);

            if (m_members.Count == 1)
            {
                SetBoss(member);
            }

            OnMemberAdded(member);

            return(true);
        }
示例#6
0
 private void BindMemberEvents(GuildMember member)
 {
     member.Connected    += new System.Action <GuildMember>(this.OnMemberConnected);
     member.Disconnected += new Action <GuildMember, Character>(this.OnMemberDisconnected);
 }
示例#7
0
 protected void UpdateMember(GuildMember member)
 {
     GuildHandler.SendGuildInformationsMemberUpdateMessage(this.m_clients, member);
 }
示例#8
0
 public bool IsTaxCollectorOwner(Stump.Server.WorldServer.Game.Guilds.GuildMember member)
 {
     return(member.Guild.Id == this.m_record.GuildId);
 }
示例#9
0
文件: Guild.cs 项目: Mixi59/Stump
 void UnBindMemberEvents(GuildMember member)
 {
     member.Connected    -= OnMemberConnected;
     member.Disconnected -= OnMemberDisconnected;
 }
示例#10
0
文件: Guild.cs 项目: Mixi59/Stump
 public void UpdateMember(GuildMember member)
 {
     GuildHandler.SendGuildInformationsMemberUpdateMessage(m_clients, member);
 }
示例#11
0
 public static void SendGuildMemberLeavingMessage(IPacketReceiver client, Stump.Server.WorldServer.Game.Guilds.GuildMember member, bool kicked)
 {
     client.Send(new GuildMemberLeavingMessage(kicked, member.Id));
 }
示例#12
0
 public static void SendGuildJoinedMessage(IPacketReceiver client, Stump.Server.WorldServer.Game.Guilds.GuildMember member)
 {
     client.Send(new GuildJoinedMessage(member.Guild.GetGuildInformations(), (uint)member.Rights, true));
 }
示例#13
0
 public static void SendGuildInformationsMemberUpdateMessage(IPacketReceiver client, Stump.Server.WorldServer.Game.Guilds.GuildMember member)
 {
     client.Send(new GuildInformationsMemberUpdateMessage(member.GetNetworkGuildMember()));
 }
示例#14
0
 public static void SendGuildMemberLeavingMessage(IPacketReceiver client, GuildMember member, bool kicked)
 {
     client.Send(new GuildMemberLeavingMessage(kicked, member.Id));
 }
示例#15
0
 public static void SendGuildMembershipMessage(IPacketReceiver client, GuildMember member)
 {
     client.Send(new GuildMembershipMessage(member.Guild.GetGuildInformations(), (int)member.Rights, true));
 }