public override void Process(Level level)
 {
     level.GetPlayerAvatar().SetName(this.PlayerName);
     var p = new AvatarNameChangeOkMessage(this.Client);
     p.SetAvatarName(level.GetPlayerAvatar().GetAvatarName());
     PacketManager.ProcessOutgoingPacket(p);
 }
Esempio n. 2
0
        public override void Process(Level level)
        {
            level.GetPlayerAvatar().SetName(this.PlayerName);
            AvatarNameChangeOkMessage expr_1C = new AvatarNameChangeOkMessage(base.Client);

            expr_1C.SetAvatarName(this.PlayerName);
            PacketManager.ProcessOutgoingPacket(expr_1C);
        }
        public override void Process(Level level)
        {
            level.GetPlayerAvatar().SetName(PlayerName);
            var p = new AvatarNameChangeOkMessage(Client);

            p.SetAvatarName(level.GetPlayerAvatar().GetAvatarName());
            PacketManager.ProcessOutgoingPacket(p);
        }
Esempio n. 4
0
        public override void Process(Level level)
        {
            var id = level.GetPlayerAvatar().GetId();
            var l  = ResourcesManager.GetPlayer(id, true);

            if (l != null)
            {
                l.GetPlayerAvatar().SetName(PlayerName);
                var p = new AvatarNameChangeOkMessage(l.GetClient());
                p.SetAvatarName(PlayerName);
                PacketManager.ProcessOutgoingPacket(p);
            }
        }
 public override void Execute(Level level)
 {
     if (level.GetAccountPrivileges() >= GetRequiredAccountPrivileges())
     {
         if (m_vArgs.Length >= 1)
         {
             try
             {
                 long id = Convert.ToInt64(m_vArgs[1]);
                 var l = ResourcesManager.GetPlayer(id, true);
                 if (l != null)
                 {
                     l.GetPlayerAvatar().SetName(m_vArgs[2]);
                     if (ResourcesManager.IsPlayerOnline(l))
                     {
                         var p = new AvatarNameChangeOkMessage(l.GetClient());
                         p.SetAvatarName(m_vArgs[2]);
                         PacketManager.ProcessOutgoingPacket(p);
                     }
                 }
                 else
                 {
                     Debugger.WriteLine("RenameAvatar failed: id " + id + " not found");
                 }
             }
             catch (Exception ex)
             {
                 Debugger.WriteLine("RenameAvatar failed with error: " + ex.ToString());
             }
         }
     }
     else
     {
         SendCommandFailedMessage(level.GetClient());
     }
 }
Esempio n. 6
0
 public override void Execute(Level level)
 {
     if (level.GetAccountPrivileges() >= GetRequiredAccountPrivileges())
     {
         if (m_vArgs.Length >= 3)
         {
             try
             {
                 long id = Convert.ToInt64(m_vArgs[1]);
                 var  l  = ResourcesManager.GetPlayer(id, true);
                 if (l != null)
                 {
                     l.GetPlayerAvatar().SetName(m_vArgs[2]);
                     if (ResourcesManager.IsPlayerOnline(l))
                     {
                         var p = new AvatarNameChangeOkMessage(l.GetClient());
                         p.SetAvatarName(m_vArgs[2]);
                         PacketManager.ProcessOutgoingPacket(p);
                     }
                 }
                 else
                 {
                     Debugger.WriteLine("RenameAvatar failed: id " + id + " not found");
                 }
             }
             catch (Exception ex)
             {
                 Debugger.WriteLine("RenameAvatar failed with error: " + ex.ToString());
             }
         }
     }
     else
     {
         SendCommandFailedMessage(level.GetClient());
     }
 }