Exemplo n.º 1
0
 public override void Execute(string commandArgs)
 {
     if (Exists(commandArgs))
     {
         LunaLog.Normal("Removed '" + commandArgs + "' from the admin list.");
         Remove(commandArgs);
         AdminSystemSender.NotifyPlayersRemovedAdmin(commandArgs);
     }
     else
     {
         LunaLog.Normal("'" + commandArgs + "' is not an admin.");
     }
 }
Exemplo n.º 2
0
        public override void HandleMessage(ClientStructure client, IMessageData messageData)
        {
            var data = (AdminBaseMsgData)messageData;

            switch (data.AdminMessageType)
            {
            case AdminMessageType.ListRequest:
                AdminSystemSender.SendAdminList(client);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 3
0
 public override void Execute(string commandArgs)
 {
     if (FileHandler.FileExists(Path.Combine(ServerContext.UniverseDirectory, "Players", commandArgs + ".txt")))
     {
         if (!Exists(commandArgs))
         {
             LunaLog.Debug("Added '" + commandArgs + "' to admin list.");
             Add(commandArgs);
             AdminSystemSender.NotifyPlayersNewAdmin(commandArgs);
         }
     }
     else
     {
         LunaLog.Normal("'" + commandArgs + "' does not exist.");
     }
 }
Exemplo n.º 4
0
        public override void HandleMessage(ClientStructure client, IClientMessageBase message)
        {
            var data = (AdminBaseMsgData)message.Data;

            switch (data.AdminMessageType)
            {
            case AdminMessageType.ListRequest:
                AdminSystemSender.SendAdminList(client);

                //We don't use this message anymore so we can recycle it
                message.Recycle();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 5
0
        public override void Execute(string commandArgs)
        {
            if (FileHandler.FileExists(Path.Combine(ServerContext.UniverseDirectory, "Players", $"{commandArgs}.txt")))
            {
                if (Exists(commandArgs))
                {
                    return;
                }

                LunaLog.Debug($"Added '{commandArgs}' to admin list.");
                Add(commandArgs);
                AdminSystemSender.NotifyPlayersNewAdmin(commandArgs);
            }
            else
            {
                LunaLog.Normal($"'{commandArgs}' does not exist.");
            }
        }