Forum

Results 1 to 3 of 3
  1. #1
    Join Date
    August 2019
    Posts
    1

    Problems getting the current Server IP

    Hello,
    I am trying to get the current server IP with the following code from the SDK but it only works on some servers.

    ts3Functions.requestServerVariables(serverConnecti onHandlerID);
    ts3Functions.getServerVariableAsString(serverConne ctionHandlerID, VIRTUALSERVER_IP, &ip);

    Getting the current Serverport works on all servers but not the IP :/ am I using the wrong functions? Would be nice if someone could tell me how to retrieve the server IP.

    thanks

  2. #2
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    143
    What exactly are you getting when it doesn't work on a server?
    Are you getting just straight up an error code, or does it return something you don't expect, like a domain or a nickname?

    If you get a domain, maybe try doing some nslookup (or something like that) in your code.

    I haven't checked this, but I think I recall some keys like VIRTUALSERVER_CONNECTION_IP parameter or something. Maybe try those.

  3. #3
    Join Date
    January 2017
    Location
    Germany
    Posts
    46
    IP+Port of the currently selected server
    ts3Functions.getConnectionVariableAsString(serverC onnectionHandlerID, myid, CONNECTION_SERVER_IP, &ip);
    ts3Functions.getServerVariableAsInt(serverConnecti onHandlerID, VIRTUALSERVER_PORT, &port);
    Last edited by Dr_Pepps; September 17th, 2019 at 05:51 PM. Reason: don't forget the semicolons kids :3

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problems getting the current Server IP
    By sKeLeTr0n in forum Client Plugins / Lua Scripts
    Replies: 8
    Last Post: March 5th, 2017, 07:32 PM
  2. Replies: 1
    Last Post: July 24th, 2014, 06:31 AM
  3. Replies: 2
    Last Post: October 6th, 2012, 02:49 AM
  4. Problems getting the current Server IP
    By sKeLeTr0n in forum Bug Reports [EN/DE]
    Replies: 3
    Last Post: December 2nd, 2010, 10:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •