Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Thomas Schühly
    @tschuehly
    Hello
    Klausmd5
    @Klausmd5
    hi
    Sandro Kierner
    @TAXSET
    Howdy!
    Thomas Schühly
    @tschuehly
    What would be the best way to access the plugins/the framework from my Spring Website backend? I'm currently deciding if I want to use a plugin framework or use the teamspeak java wrapper directly.
    I moved our member database from a Google Sheet to a custom database with a webfrontend and want to manage our Teamspeak rights completly with the database
    Sandro Kierner
    @TAXSET

    The TSQPFs main purpose is to simplify the development of applications (called plugins in the framework) using the TS3 API. So basically, you'll only need to worry about your plugin and not the API setup as that's managed by the framework.

    There are also some other features like a log output, exception handler, detailed config, command line, etc.

    Finally, you'll only have to use ONE query connection by using the TSQPF, which saves traffic and slots.

    When it comes to your goal of having communication between your Spring framework and the TSQP Framework, you'll need to create a new plugin that will host a socket. This socket can then be used by your Spring application. I'll add an example run() of a server thread below:

    ServerSocket serverSocket = null;
            try {
                serverSocket = new ServerSocket(5612);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if(serverSocket == null) return;
            while (true) {
                Socket socket = null;
                try {
                    socket = serverSocket.accept();
                    InputStream input = socket.getInputStream();
    
                    String token = readTil(input, '\n');
                    if(!token.equals(TOKEN))  {
                        socket.close();
                        continue;
                    }
                    String cmd = readTil(input, '\n');
                    String response = processCommand(cmd);
                    if(response.length()>1) {
                        socket.getOutputStream().write(response.getBytes(StandardCharsets.UTF_8));
                        socket.getOutputStream().flush();
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                } finally {
                    if(socket != null) {
                        try {
                            socket.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }

    Please bear in mind that this connection is insecure/unencrypted. Hope I could help and answer your question. ^^

    Also, if you don't want to read through every page of the documentation, you can simply copy the plugin template and get started from there (https://github.com/Teamspeak-Query-Plugin-Framework/tsqpf-plugin-template).