-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
900 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
|
||
package main | ||
|
||
const UsageText = | ||
`Example: | ||
minecraft_installer -name minecraft_server -version 1.7.10 | ||
const UsageText = ` | ||
minecraft_installer [...flags] [<server_type>] | ||
minecraft_installer [...flags] modpack <modpack_file> | ||
Example: | ||
Install servers: | ||
minecraft_installer -name minecraft_server -version 1.7.10 | ||
Install minecraft 1.7.10 vanilla server into minecraft_server.jar | ||
minecraft_installer -name minecraft_server -version 1.19.2 -server forge | ||
minecraft_installer -name minecraft_server -version 1.19.2 forge | ||
Install minecraft 1.19.2 forge server into current directory and the executable is minecraft_server.sh | ||
Hint: forge installer will make run scripts for the minecraft version that higher or equal than 1.17 | ||
for version that less than 1.17, you still need to use 'java -jar' to run the server | ||
minecraft_installer -name minecraft_server -version 1.19.2 -server fabric -output server | ||
minecraft_installer -name minecraft_server -version 1.19.2 -output server fabric | ||
Install minecraft 1.19.2 fabric server into server/minecraft_server.jar | ||
Install modpacks: | ||
minecraft_installer -name modpack_server modpack /path/to/modrinch-modpack.mrpack | ||
Install the modpack from local to the current directory | ||
Hint: Only support modrinch modpack for now, curseforge is in progress | ||
minecraft_installer -name modpack_server modpack 'https://cdn-raw.modrinth.com/data/sl6XzkCP/versions/i4agaPF2/Automation%20v3.3.mrpack' | ||
Install the modpack from internet to the current directory | ||
Hint: if you want to install modpack from the internet, | ||
you must add the prefixs [https://, http://] | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
package installer | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
type UnsupportGameErr struct { | ||
Game string | ||
} | ||
|
||
func (e *UnsupportGameErr)Error()(string){ | ||
return fmt.Sprintf("Unsupport game type %q", e.Game) | ||
} | ||
|
||
type NotLocalPathErr struct { | ||
Path string | ||
} | ||
|
||
func (e *NotLocalPathErr)Error()(string){ | ||
return fmt.Sprintf("%q is not a local path", e.Path) | ||
} | ||
|
||
type HashErr struct { | ||
Hash string | ||
Sum string | ||
Expect string | ||
} | ||
|
||
func (e *HashErr)Error()(string){ | ||
return fmt.Sprintf("Unexpect %s hash %s, expect %s", e.Hash, e.Sum, e.Expect) | ||
} | ||
|
||
type HttpStatusError struct{ | ||
Code int | ||
} | ||
|
||
func (e *HttpStatusError)Error()(string){ | ||
return fmt.Sprintf("Unexpect http status %d %s", e.Code, http.StatusText(e.Code)) | ||
} | ||
|
||
type ContentLengthNotMatchErr struct { | ||
ContentLength int64 | ||
Expect int64 | ||
} | ||
|
||
func (e *ContentLengthNotMatchErr)Error()(string){ | ||
return fmt.Sprintf("Unexpect content length %d, expect %d", e.ContentLength, e.Expect) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.