Пример #1
0
 public override void Execute(Level level)
 {
     if (level.GetAccountPrivileges() >= GetRequiredAccountPrivileges())
     {
         if (m_vArgs.Length >= 3)
         {
             try
             {
                 var id = Convert.ToInt64(m_vArgs[1]);
                 var l = ResourcesManager.GetPlayer(id);
                 if (l != null)
                 {
                     l.GetPlayerAvatar().SetName(m_vArgs[2]);
                     if (ResourcesManager.IsPlayerOnline(l))
                     {
                         var p = new AvatarNameChangeOkMessage(l.GetClient());
                         //p.SetAvatarName(m_vArgs[2]);
                         p.Send();
                     }
                 }
                 else
                 {
                 }
             }
             catch (Exception ex)
             {
             }
         }
     }
     else
     {
         SendCommandFailedMessage(level.GetClient());
     }
 }
Пример #2
0
        internal override async void Process()
        {
            try
            {
                long  id = this.Device.Player.Avatar.UserId;
                Level l  = await ResourcesManager.GetPlayer(id);

                if (l != null)
                {
                    if (PlayerName.Length > 15)
                    {
                        ResourcesManager.DisconnectClient(Device);
                    }
                    else
                    {
                        l.Avatar.SetName(PlayerName);
                        AvatarNameChangeOkMessage p = new AvatarNameChangeOkMessage(l.Client)
                        {
                            AvatarName = PlayerName
                        };
                        p.Send();
                    }
                }
            } catch (Exception) { }
        }
Пример #3
0
        public override void Process(Level level)
        {
            level.GetPlayerAvatar().SetName(PlayerName);
            var p = new AvatarNameChangeOkMessage(Client);

            p.SetAvatarName(level.GetPlayerAvatar().GetAvatarName());
            p.Send();
        }
Пример #4
0
        /// <summary>
        ///     <see cref="Process" /> this instance.
        /// </summary>
        public override void Process(Level level)
        {
            this.Client.GetLevel().GetPlayerAvatar().SetName(this.Name);
            var p = new AvatarNameChangeOkMessage(this.Client);

            p.SetAvatarName(this.Client.GetLevel().GetPlayerAvatar().GetAvatarName());
            p.Send();

            new Server_Commands(this.Client)
            {
                _Command = new Name_Change_Callback(this.Client).Handle()
            }.Send();
        }
Пример #5
0
        public override void Process(Level level)
        {
            var id = level.GetPlayerAvatar().GetId();
            var l  = ResourcesManager.GetPlayer(id);

            if (l != null)
            {
                l.GetPlayerAvatar().SetName(PlayerName);
                var p = new AvatarNameChangeOkMessage(l.GetClient());
                p.SetAvatarName(PlayerName);
                p.Send();
            }
        }
Пример #6
0
 internal override void Process()
 {
     if (string.IsNullOrEmpty(PlayerName) || PlayerName.Length > 15)
     {
         ResourcesManager.DisconnectClient(Device);
     }
     else
     {
         this.Device.Player.Avatar.SetName(PlayerName);
         this.Device.Player.Avatar.m_vNameChangingLeft--;
         AvatarNameChangeOkMessage p = new AvatarNameChangeOkMessage(this.Device)
         {
             AvatarName = this.Device.Player.Avatar.AvatarName
         };
         p.Send();
     }
     //new RequestConfirmChangeNameMessage(Client, PlayerName);
 }