Compare commits

...

6 Commits

Author SHA1 Message Date
jack77213 b153fadff7
build for 64bit linux 2020-10-16 18:18:51 +08:00
jack77213 5bdd19cef0 merge 2020-08-03 17:13:13 +08:00
jack77213 35f2bc47e5 2020-08-03 17:06:38 +08:00
jack77213 e80f4e36ef 2020-08-03 17:06:26 +08:00
jack77213 da3d3f0b31 fix 2020-08-03 17:06:12 +08:00
jack77213 654efb8f3a 更新 'extension/liba3tg.go' 2020-08-02 10:20:06 +00:00
4 changed files with 15 additions and 6 deletions

View File

@ -13,17 +13,21 @@ a3tg.pbo: $(ARMASRC)
liba3tg.so: $(GOSRC)
cd extension && GOARCH=386 CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg.so -buildmode=c-shared .
liba3tg_x64.so: $(GOSRC)
cd extension && GOARCH=amd64 CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg_x64.so -buildmode=c-shared .
liba3tg.dll: $(GOSRC)
cd extension && GOOS=windows GOARCH=386 CC=i686-w64-mingw32-cc CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg.dll -buildmode=c-shared .
liba3tg_x64.dll: $(GOSRC)
cd extension && GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-cc CGO_ENABLED=1 go build $(LDFLAGS) -o ../liba3tg_x64.dll -buildmode=c-shared .
build: liba3tg.so liba3tg.dll liba3tg_x64.dll a3tg.pbo
build: liba3tg.so liba3tg_x64.so liba3tg.dll liba3tg_x64.dll a3tg.pbo
clean:
-rm a3tg.pbo
-rm ./liba3tg.so
-rm ./liba3tg_x64.so
-rm ./liba3tg.dll
-rm ./liba3tg_x64.dll
-rm ./liba3tg.h

View File

@ -14,7 +14,7 @@ if (!isServer) exitWith {};
params ["_name", "_function", "_data"];
if (_name isEqualTo "a3tg") then
{
(format ["[TG] %2: %3", _function, _data]) remoteExecCall ["systemChat", -2, true];
(format ["[TG] %1: %2", _function, _data]) remoteExecCall ["systemChat", -2, true];
};
}];

View File

@ -1,4 +1,5 @@
params ["_name", "_message"];
"liba3tg" callExtension ["chat", [_name, _message]];
if ( !((_message select [0, 1]) isEqualTo "#") ) then {
"liba3tg" callExtension ["chat", [_name, _message]];
};

View File

@ -12,7 +12,11 @@ package main
}
#if __x86_64__
static inline unsigned long long min(unsigned long long a, unsigned long long b) { return a < b ? a : b; }
#ifdef __MINGW32__
static inline unsigned long long min(unsigned long long a, unsigned long long b) { return a < b ? a : b; }
#else
static inline unsigned long min(unsigned long a, unsigned long b) { return a < b ? a : b; }
#endif
#else
static inline unsigned int min(unsigned int a, unsigned int b) { return a < b ? a : b; }
#endif
@ -87,6 +91,6 @@ func handleArgs(function string, argc C.int, argv []string) {
return
}
sendToTelegram(argv[0], argv[1])
go sendToTelegram(argv[0], argv[1])
//log.Println(argc, argv[0], argv[1])
}