Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public override void RemoveMember(Session member)
        {
            NetworkObject fellowshipMemberLeave = new NetworkObject();

            fellowshipMemberLeave.AddField(0, NetworkObjectField.CreateIntField((int)FellowshipAction.MemberLeave));
            fellowshipMemberLeave.AddField(1, NetworkObjectField.CreateObjectField(Info.ToNetworkObject()));
            fellowshipMemberLeave.AddField(2, NetworkObjectField.CreateUShortField((ushort)member.Character.Sequence));
            BroadcastMessage(ObjectOpcode.Fellowship, fellowshipMemberLeave);

            base.RemoveMember(member);
            member.Fellowships.Remove(this);

            NetworkObject fellowshipLeave = new NetworkObject();

            fellowshipLeave.AddField(0, NetworkObjectField.CreateIntField((int)FellowshipAction.Leave));
            fellowshipLeave.AddField(1, NetworkObjectField.CreateObjectField(Info.ToNetworkObject()));
            member.EnqueueMessage(ObjectOpcode.Fellowship, fellowshipLeave);
        }
Пример #2
0
        protected override void OnRemoveMember(CharacterObject character)
        {
            NetworkObject fellowshipMemberLeave = new NetworkObject();

            fellowshipMemberLeave.AddField(0, NetworkObjectField.CreateIntField((int)FellowshipAction.MemberLeave));
            fellowshipMemberLeave.AddField(1, NetworkObjectField.CreateObjectField(Info.ToNetworkObject()));
            fellowshipMemberLeave.AddField(2, NetworkObjectField.CreateUShortField((ushort)character.Sequence));
            BroadcastMessage(ObjectOpcode.Fellowship, fellowshipMemberLeave);

            members.Remove(character.Sequence);

            Session session = NetworkManager.FindSessionByCharacter(character);

            if (session != null)
            {
                session.Fellowships.Remove(this);

                NetworkObject fellowshipLeave = new NetworkObject();
                fellowshipLeave.AddField(0, NetworkObjectField.CreateIntField((int)FellowshipAction.Leave));
                fellowshipLeave.AddField(1, NetworkObjectField.CreateObjectField(Info.ToNetworkObject()));
                session.EnqueueMessage(ObjectOpcode.Fellowship, fellowshipLeave);
            }
        }