FlashyReese / CommandAliases

Alternate short commands for complex commands
MIT License
25 stars 6 forks source link

I'm unable to use my "old" aliases #31

Closed kraoc closed 2 years ago

kraoc commented 2 years ago

Here is my "current" config/commandaliases.json :

[
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"tonnerre",
         "redirectTo":"weather thunder"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"pluie",
         "redirectTo":"weather rain"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"clair",
         "redirectTo":"weather clear"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"jour",
         "redirectTo":"time set day"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"nuit",
         "redirectTo":"time set night"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"survie",
         "redirectTo":"gamemode survival"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"creatif",
         "redirectTo":"gamemode creative"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"aventure",
         "redirectTo":"gamemode adventure"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"spectateur",
         "redirectTo":"gamemode spectator"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"paisible",
         "redirectTo":"difficulty peaceful"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"facile",
         "redirectTo":"difficulty easy"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"normal",
         "redirectTo":"difficulty normal"
      }
   },
   {
      "commandMode":"COMMAND_REDIRECT_NOARG",
      "redirectCommand":{
         "command":"difficile",
         "redirectTo":"difficulty hard"
      }
   }
]

I don't figure how to use in in config/commandaliases new format.

May you help ?

FlashyReese commented 2 years ago

Sorry about the warning in the logs, if you migrate right now you will need to change every one of the aliases again for 1.0.0 because the format has changed. I recommend sticking with the old one for now, if you want to still go ahead and do it. The config/commandaliases folder takes individual aliases only. So for example it would look something like this:

JSON format

config/commandaliases/tonnerre.json

{
  "commandMode": "COMMAND_REDIRECT_NOARG",
  "redirectCommand": {
    "command": "tonnerre",
    "redirectTo": "weather thunder"
  }
}

TOML format

config/commandaliases/tonnerre.toml

commandMode = "COMMAND_REDIRECT_NOARG"

[redirectCommand]
command = "tonnerre"
redirectTo = "weather thunder"

YAML format

config/commandaliases/tonnerre.yml

commandMode: COMMAND_REDIRECT_NOARG
redirectCommand:
  command: tonnerre
  redirectTo: weather thunder
kraoc commented 2 years ago

Ok ! Thanks for your quick reply.

Specify that commandalias folder is for individual command alias as it's unclear :)

It's not a problem for me to switch to individual files... I just need to ssh a little ;o) ... and duplicates my files across my servers!

FlashyReese commented 2 years ago

Ok ! Thanks for your quick reply.

Specify that commandalias folder is for individual command alias as it's unclear :)

It's not a problem for me to switch to individual files... I just need to ssh a little ;o) ... and duplicates my files across my servers!

I would actually recommend against moving yet if you plan to update to 1.0.0. The 1.0.0 format is slightly different from these. If you migrate them now and want to update to 1.0.0 you will need to rewrite them again.

kraoc commented 2 years ago

Seems good :)

06:51:56] [Server thread/INFO]: commandaliases ├── tonnerre.json - Successfully loaded ├── pluie.json - Successfully loaded ├── clair.json - Successfully loaded ├── jour.json - Successfully loaded ├── nuit.json - Successfully loaded ├── survie.json - Successfully loaded ├── creatif.json - Successfully loaded ├── aventure.json - Successfully loaded ├── spectateur.json - Successfully loaded ├── paisible.json - Successfully loaded ├── facile.json - Successfully loaded ├── normal.json - Successfully loaded └── difficile.json - Successfully loaded

...

pluie [06:53:28] [Server thread/INFO]: Set the weather to rain

kraoc commented 2 years ago

Ok ! Thanks for your quick reply. Specify that commandalias folder is for individual command alias as it's unclear :) It's not a problem for me to switch to individual files... I just need to ssh a little ;o) ... and duplicates my files across my servers!

I would actually recommend against moving yet if you plan to update to 1.0.0. The 1.0.0 format is slightly different from these. If you migrate them now and want to update to 1.0.0 you will need to rewrite them again.

Not a big deal :) I switched only on my currently running server, remaining others on the old format.

Thanks anyway for this mod ! It make easier for childs to change weather :p