コード例 #1
0
ファイル: Guild.cs プロジェクト: thepirateclub/netgore
        /// <summary>
        /// When overridden in the derived class, allows for additional handling of when a member of this
        /// guild has gone offline.
        /// </summary>
        /// <param name="guildMember">The guild member that went offline.</param>
        protected override void OnOnlineUserRemoved(IGuildMember guildMember)
        {
            base.OnOnlineUserRemoved(guildMember);

            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteRemoveOnlineMember(x, guildMember.Name)))
            {
                Send(pw);
            }
        }
コード例 #2
0
ファイル: Guild.cs プロジェクト: thepirateclub/netgore
        /// <summary>
        /// When overridden in the derived class, allows for additional handling after a guild member is kicked.
        /// Use this instead of the corresponding event when possible.
        /// </summary>
        /// <param name="invoker">The guild member that invoked the event.</param>
        /// <param name="target">The optional guild member the event involves.</param>
        protected override void OnMemberKicked(IGuildMember invoker, IGuildMember target)
        {
            base.OnMemberKicked(invoker, target);

            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteRemoveMember(x, target.Name)))
            {
                Send(pw);
            }
        }
コード例 #3
0
ファイル: Guild.cs プロジェクト: thepirateclub/netgore
        /// <summary>
        /// When overridden in the derived class, allows for additional handling after a guild member is promoted.
        /// Use this instead of the corresponding event when possible.
        /// </summary>
        /// <param name="invoker">The guild member that invoked the event.</param>
        /// <param name="target">The optional guild member the event involves.</param>
        protected override void OnMemberPromoted(IGuildMember invoker, IGuildMember target)
        {
            base.OnMemberPromoted(invoker, target);

            var v = new GuildMemberNameRank(target.Name, target.GuildRank);

            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteUpdateMemberRank(x, v)))
            {
                Send(pw);
            }
        }
コード例 #4
0
ファイル: Guild.cs プロジェクト: thepirateclub/netgore
        /// <summary>
        /// When overridden in the derived class, allows for additional handling after a new guild member is added.
        /// Use this instead of the corresponding event when possible.
        /// </summary>
        /// <param name="newMember"></param>
        protected override void OnMemberAdded(IGuildMember newMember)
        {
            base.OnMemberAdded(newMember);

            var v = new GuildMemberNameRank(newMember.Name, newMember.GuildRank);

            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteAddMember(x, v)))
            {
                Send(pw);
            }
        }
コード例 #5
0
ファイル: Guild.cs プロジェクト: thepirateclub/netgore
        /// <summary>
        /// When overridden in the derived class, allows for additional handling after the guild's tag has changed.
        /// Use this instead of the corresponding event when possible.
        /// </summary>
        /// <param name="invoker">The guild member that invoked the event.</param>
        /// <param name="oldTag">The old tag.</param>
        /// <param name="newTag">The new tag.</param>
        protected override void OnTagChanged(IGuildMember invoker, string oldTag, string newTag)
        {
            using (var pw = ServerPacket.SendMessage(GameMessage.GuildRetagged, oldTag, newTag, invoker.Name))
            {
                Send(pw);
            }

            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteUpdateNameTag(x, Name, Tag)))
            {
                Send(pw);
            }
        }
コード例 #6
0
        /// <summary>
        /// When overridden in the derived class, handles when the <see cref="GuildMemberInfo{T}.Owner"/> leaves a guild.
        /// </summary>
        /// <param name="guild">The guild that was left.</param>
        protected override void HandleLeaveGuild(IGuild guild)
        {
            using (var pw = ServerPacket.GuildInfo(x => UserGuildInformation.WriteGuildInfo(x, null)))
            {
                Owner.Send(pw, ServerMessageType.GUI);
            }

            if (!Owner.IsLoaded)
            {
                return;
            }

            Owner.Send(GameMessage.GuildLeave, ServerMessageType.GUI, guild.Name);

            WorldStatsTracker.Instance.AddUserGuildChange(Owner, null);
        }