This repository was archived by the owner on May 18, 2023. It is now read-only.
File tree 4 files changed +22
-6
lines changed
4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
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"`
7
8
}
8
9
9
10
type DownloadImgEntity struct {
Original file line number Diff line number Diff line change @@ -118,7 +118,14 @@ func getUrlPngData(url string) C.CgoSlice {
118
118
}
119
119
maxw , maxh , maxsize := ReadConfig ()
120
120
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 {
122
129
resp , err := http .Get (url )
123
130
defer resp .Body .Close ()
124
131
if err != nil {
Original file line number Diff line number Diff line change @@ -308,6 +308,9 @@ namespace Helper {
308
308
case -5 : {
309
309
pl->sendText (" §l§6[CustomMapX] §cImage decoding failure!" );
310
310
}
311
+ case -6 : {
312
+ pl->sendText (" §l§6[CustomMapX] §cImage exceeds maximum allowed size!" );
313
+ }
311
314
}
312
315
}
313
316
if (imagedata.length () > 0 && data != nullptr ) {
@@ -580,7 +583,12 @@ void PluginInit()
580
583
{
581
584
loadCfg ();
582
585
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 (" " );
584
592
if (!std::filesystem::exists (" plugins/CustomMapX" ))
585
593
std::filesystem::create_directories (" plugins/CustomMapX" );
586
594
if (!std::filesystem::exists (" plugins/CustomMapX/picture" ))
Original file line number Diff line number Diff line change 13
13
#define PLUGIN_VERSION_REVISION 0
14
14
#define PLUGIN_VERSION_BUILD 0
15
15
#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)
17
17
//#define TARGET_BDS_PROTOCOL_VERSION 503
18
18
// used by github actions(TODO)
19
19
//#define TARGET_BDS_VERSION 1.18.30.04
You can’t perform that action at this time.
0 commit comments