From 595946a4a2901df4bd9e421ebfb6e104227b9f2e Mon Sep 17 00:00:00 2001 From: Niklas Date: Fri, 4 Sep 2020 21:34:07 +0200 Subject: [PATCH] IT WORKS --- .gitignore | 2 ++ src/go/tsgo_export.go | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6a5ccf0..22fa04f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /_obj *.o +*.a +*.so tsgo_export.h \ No newline at end of file diff --git a/src/go/tsgo_export.go b/src/go/tsgo_export.go index b3788d4..988507a 100644 --- a/src/go/tsgo_export.go +++ b/src/go/tsgo_export.go @@ -1,6 +1,7 @@ package main // #cgo CFLAGS: -I../../ts3client-pluginsdk/include -I../c +// #cgo LDFLAGS: -Wl,-unresolved-symbols=ignore-all // #include // #include "teamspeak/public_errors.h" // #include "teamspeak/public_errors_rare.h" @@ -8,7 +9,7 @@ package main // #include "teamspeak/public_rare_definitions.h" // #include "teamspeak/clientlib_publicdefinitions.h" // #include "plugin_definitions.h" -// #include "ts3FunctionsWrapper.h" +// extern void Ts3FncPrintMessage(uint64 serverConnectionHandlerID, const char* message, enum PluginMessageTarget messageTarget); import "C" import ( tsgo "./tsgo" @@ -60,7 +61,7 @@ func GoTs3pluginShutdown() { */ //export GoTs3onClientPokeEvent -func GoTs3onClientPokeEvent(serverConnectionHandlerID uint64, fromClientID C.anyID, pokerName *C.char, pokerUniqueIdentity *C.char, message *C.char, ffIgnored int) int { - C.Ts3FncPrintMessage(serverConnectionHandlerID, C.CString(""), C.PLUGIN_SERVER) - return 0 +func GoTs3onClientPokeEvent(serverConnectionHandlerID C.uint64, fromClientID C.anyID, pokerName *C.char, pokerUniqueIdentity *C.char, message *C.char, ffIgnored int) C.int { + C.Ts3FncPrintMessage(serverConnectionHandlerID, C.CString("Ayyyy"), C.PLUGIN_SERVER) + return 1 }