Skip to content

Commit

Permalink
移除 mcbbs 下载源
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdhs committed Feb 19, 2024
1 parent aa94bfb commit 16234d9
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

自定义启动 jvm 参数 `./gml-linux -run 1.16.1 -username xmdhs -flag "-XX:+AggressiveOpts -XX:+UseCompressedOops"`

下载游戏并指定镜像下载源并设置使用的协程数为 32 `./gml-linux -downver 1.16.1 -type=mcbbs -int 32`
下载游戏并指定镜像下载源并设置使用的协程数为 32 `./gml-linux -downver 1.16.1 -type=bmclapi -int 32`

下载游戏并混合的使用两个下载源 `./gml-linux -downver 1.16.1 -type "mcbbs|vanilla"`
下载游戏并混合的使用两个下载源 `./gml-linux -downver 1.16.1 -type "bmclapi|vanilla"`

查看所有可以下载的正式版本 `./gml-linux -verlist release``release` 为版本类型,可通过下面的命令获取。

Expand Down
1 change: 0 additions & 1 deletion auth/authlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const (

// Deprecated: move to package download
var Authliburls = []string{
"https://download.mcbbs.net/mirrors/authlib-injector/artifact/41/authlib-injector-1.1.41.jar",
"https://authlib-injector.yushi.moe/artifact/41/authlib-injector-1.1.41.jar",
"https://bmclapi2.bangbang93.com/mirrors/authlib-injector/artifact/41/authlib-injector-1.1.41.jar",
}
Expand Down
3 changes: 1 addition & 2 deletions download/auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ func newrandurls(typee string) *randurls {
r := &randurls{}
r.typeweight = make(map[string]int)
if typee == "" {
r.typeweight["vanilla"] = 50
r.typeweight["vanilla"] = 40
r.typeweight["bmclapi"] = 50
r.typeweight["mcbbs"] = 20
} else {
s := strings.Split(typee, "|")
for _, v := range s {
Expand Down
9 changes: 4 additions & 5 deletions download/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
)

func Test_randurls_auto(t *testing.T) {
r := newrandurls("mcbbs")
r := newrandurls("bmclapi")
_, m := r.auto()
if m != "mcbbs" {
if m != "bmclapi" {
t.Fail()
}
r = newrandurls("")
Expand All @@ -20,9 +20,8 @@ func Test_randurls_auto(t *testing.T) {

func TestFail(t *testing.T) {
r := newrandurls("")
for i := 0; i < 20; i++ {
r.fail("mcbbs")
for i := 0; i < 50; i++ {
r.fail("bmclapi")
}
require.Equal(t, "vanilla", r.fail("mcbbs"))
require.Equal(t, "vanilla", r.fail("bmclapi"))
}
1 change: 0 additions & 1 deletion download/downauthlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func Downauthlib(cxt context.Context, print func(string)) (err error) {
var authlibUrls = []string{
"https://authlib-injector.yushi.moe/artifact/latest.json",
"https://bmclapi2.bangbang93.com/mirrors/authlib-injector/artifact/latest.json",
"https://download.mcbbs.net/mirrors/authlib-injector/artifact/latest.json",
}

func randAuthlibUrls(url string) string {
Expand Down
10 changes: 0 additions & 10 deletions download/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ var mirror = map[string]map[string]string{
`files.minecraftforge.net/maven`: `bmclapi2.bangbang93.com/maven`,
`maven.minecraftforge.net`: `bmclapi2.bangbang93.com/maven`,
},
"mcbbs": {
`launchermeta.mojang.com`: `download.mcbbs.net`,
`piston-meta.mojang.com`: `download.mcbbs.net`,
`piston-data.mojang.com`: `download.mcbbs.net`,
`launcher.mojang.com`: `download.mcbbs.net`,
`resources.download.minecraft.net`: `download.mcbbs.net/assets`,
`libraries.minecraft.net`: `download.mcbbs.net/maven`,
`files.minecraftforge.net/maven`: `download.mcbbs.net/maven`,
`maven.minecraftforge.net`: `download.mcbbs.net/maven`,
},
}

func source(url, types string) string {
Expand Down
8 changes: 4 additions & 4 deletions download/libraries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func Test_source(t *testing.T) {
name: "1",
args: args{
url: "https://piston-meta.mojang.com/mc/game/version_manifest.json",
types: "mcbbs",
types: "bmclapi",
},
want: "https://download.mcbbs.net/mc/game/version_manifest.json",
want: "https://bmclapi2.bangbang93.com/mc/game/version_manifest.json",
},
{
name: "2",
Expand All @@ -89,9 +89,9 @@ func Test_source(t *testing.T) {
name: "3",
args: args{
url: "https://piston-meta.mojang.com/mc/game/version_manifest.json/piston-meta.mojang.com",
types: "mcbbs",
types: "bmclapi",
},
want: "https://download.mcbbs.net/mc/game/version_manifest.json/piston-meta.mojang.com",
want: "https://bmclapi2.bangbang93.com/mc/game/version_manifest.json/piston-meta.mojang.com",
},
}
for _, tt := range tests {
Expand Down
2 changes: 1 addition & 1 deletion lang/en.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var en = map[string]string{
"ramusage": "分配启动游戏的内存大小(mb)",
"flagusage": "自定的启动参数,比如 -XX:+AggressiveOpts -XX:+UseCompressedOops",
"proxyusage": "设置下载用的代理(http)",
"typeusage": `设置下载源。可选 vanilla bmclapi 和 mcbbs,不设置此项则使用将自动的为每一个文件选择下载源。可以使用 "bmclapi|vanilla" 的形式来负载均衡的使用多个下载源。`,
"typeusage": `设置下载源。可选 vanilla bmclapi,不设置此项则使用将自动的为每一个文件选择下载源。可以使用 "bmclapi|vanilla" 的形式来负载均衡的使用多个下载源。`,
"Independentusage": "是否开启版本隔离",
"testusage": "启动游戏前是否效验文件的完整和正确性",
"creditsusage": "使用的一些项目",
Expand Down
2 changes: 1 addition & 1 deletion lang/zh.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var zh = map[string]string{
"ramusage": "分配启动游戏的内存大小(mb)",
"flagusage": "自定的 jvm 参数,比如 -XX:+AggressiveOpts -XX:+UseCompressedOops",
"proxyusage": "设置下载用的代理(http)",
"typeusage": `设置下载源。可选 vanilla bmclapi 和 mcbbs,不设置此项则使用将自动的为每一个文件选择下载源。可以使用 "bmclapi|vanilla" 的形式来负载均衡的使用多个下载源。`,
"typeusage": `设置下载源。可选 vanilla bmclapi,不设置此项则使用将自动的为每一个文件选择下载源。可以使用 "bmclapi|vanilla" 的形式来负载均衡的使用多个下载源。`,
"Independentusage": "是否开启版本隔离",
"testusage": "启动游戏前是否效验文件的完整和正确性",
"creditsusage": "使用的一些项目",
Expand Down

0 comments on commit 16234d9

Please sign in to comment.