Skip to content
This repository was archived by the owner on May 18, 2023. It is now read-only.

Commit 91b672b

Browse files
committed
1.1.0
1 parent 603943e commit 91b672b

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

GOHelper/json.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package main
22

33
type RootEntity struct {
4-
DownloadImg DownloadImgEntity `json:"DownloadImg"`
5-
ImgSize ImgSizeEntity `json:"ImgSize"`
6-
LocalImg LocalImgEntity `json:"LocalImg"`
4+
DownloadImg DownloadImgEntity `json:"DownloadImg"`
5+
ImgSize ImgSizeEntity `json:"ImgSize"`
6+
LocalImg LocalImgEntity `json:"LocalImg"`
7+
MemberRateLimit int64 `json:"MemberRateLimit"`
78
}
89

910
type DownloadImgEntity struct {

GOHelper/png.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ func getUrlPngData(url string) C.CgoSlice {
118118
}
119119
maxw, maxh, maxsize := ReadConfig()
120120
length := float64(header.ContentLength) / 1024 / 1024
121-
if length != 0 && length <= float64(maxsize) {
121+
if length > float64(maxsize) {
122+
var ret C.CgoSlice
123+
ret.data = nil
124+
ret.len = C.longlong(-6)
125+
ret.cap = C.longlong(0)
126+
return ret
127+
}
128+
if length != 0 {
122129
resp, err := http.Get(url)
123130
defer resp.Body.Close()
124131
if err != nil {

Template/Plugin.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ namespace Helper {
308308
case -5: {
309309
pl->sendText("§l§6[CustomMapX] §cImage decoding failure!");
310310
}
311+
case -6: {
312+
pl->sendText("§l§6[CustomMapX] §cImage exceeds maximum allowed size!");
313+
}
311314
}
312315
}
313316
if (imagedata.length() > 0 && data != nullptr) {
@@ -580,7 +583,12 @@ void PluginInit()
580583
{
581584
loadCfg();
582585
golang();
583-
logger.info("Loaded");
586+
Logger().info(" ___ _ _____ __ ");
587+
Logger().info(" / __\\/\\/\\ /_\\ / _ \\ \\/ / ");
588+
Logger().info(" / / / \\ //_\\\\ / /_)/\\ / \033[38;5;221mVersion:{}", PLUGIN_VERSION_STRING);
589+
Logger().info("/ /__/ /\\/\\ \\/ _ \\/ ___/ / \\ \033[38;5;218mGithub:{}", "https://github.com/dreamguxiang/CustomMapX");
590+
Logger().info("\\____|/ \\/\\_/ \\_/\\/ /_/\\_\\ ");
591+
Logger().info("");
584592
if (!std::filesystem::exists("plugins/CustomMapX"))
585593
std::filesystem::create_directories("plugins/CustomMapX");
586594
if (!std::filesystem::exists("plugins/CustomMapX/picture"))

Template/Version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define PLUGIN_VERSION_REVISION 0
1414
#define PLUGIN_VERSION_BUILD 0
1515
#define PLUGIN_VERSION_STATUS PLUGIN_VERSION_DEV
16-
16+
#define PLUGIN_VERSION_STRING TO_VERSION_STRING(PLUGIN_VERSION_MAJOR.PLUGIN_VERSION_MINOR.PLUGIN_VERSION_REVISION)
1717
//#define TARGET_BDS_PROTOCOL_VERSION 503
1818
// used by github actions(TODO)
1919
//#define TARGET_BDS_VERSION 1.18.30.04

0 commit comments

Comments
 (0)