gc-plugin | ||
gradle/wrapper | ||
.gitattributes | ||
.gitignore | ||
build.gradle | ||
gradlew | ||
gradlew.bat | ||
README.md | ||
settings.gradle |
MojoConsolePlus
MojoConsolePlus(MCP) is a Grasscutter plugin (Apart from Ben4j's GCGM plugin) and it's goal is to implement fully in-game webwiew based .
Currently Features:
- Send console link in game
- Do what players can do in the in-game chat based console
- Inherit the original permission system
- Capture command response to plugin instead of send chat to player
- More configurable
Important Notes:
This plugin is made to run on the current Development branch of Grasscutter.
This plugin is in very early development and only have the backend now. Frontend is extermely hardcore.
If you require support please ask on the Grasscutter Discord. However, support is not guarenteed.
MojoConsolePlus is decoupled with any frontend yet, feel free to open a PR to introduce your implented frontend.
Development frontend for MojoConsolePlus don't have to restart the Grasscutter server. Just refresh page! There will be a URL printed to the console as log to help you access the console in your browser for development.
Setup
Download Plugin Jar
See realeases.
Compile yourself
-
Pull the latest code from github using
git clone https://github.com/mingjun97/gc-mojoconsole-plus
in your terminal of choice. -
Locate your grasscutter server and copy the
grasscutter
server jar into the newly createdgcgm-plugin/gc-plugin/lib
folder -
Navigate back into the project root folder called
gc-mojoconsole-plus
folder and rungradlew build
(cmd) or./gradlew build
(Powershell, Linux & Mac). -
Assuming the build succeeded, in your file explorer navigate to the
gc-plugin
folder, you should have amojoconsole.jar
file, copy it. -
Navigate to your
Grasscutter
server, find theplugins
folder and paste themojoconsole.jar
into it. -
Start your server.
-
Put the all the frontend files into the folder
GRASSCUTTER_RESOURCE/gcstatic/mojo/console.html
. -
Send command
/mojoconsole
or/mojo
to server in game, and you will receive mail in your mailbox. Then follow the instructions there.
Your final plugins folder's directory structure should look similar to this
plugins
│ mojoconsole.jar
│ ...
resources
└───gcstatic
│ ...
└───mojo
│ console.html
| ...
└───any other file that you want to include in your frontend
│ ...
API
URL: /mojoplus/api
Request: Content-Type: application/json
{
"k": "SESSION_KEY", // sesssion key is embedded in the mail, can be retreved via the GET params.
"request": "invoke", // set request to ping will ignore the payload, which just check the aliveness of current sessionKey
"payload": "command just like what you do in your in game chat console" // example: "heal" for heal all avatars
}
Resources: You can use the following function to send the request, just plug it after you finished the command generation job.