Forum

Results 1 to 9 of 9
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    38

    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
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Tested it with the lua plugin (didn't had the time to test it with a standalone plugin) and can confirm that.

  3. #3
    Join Date
    December 2009
    Location
    Germany
    Posts
    38
    There is a Bug in the Function that tells you the IP Adress of your current Server! In most cases it doesn't give you any IP adress at all. I really need this function to be working. Please could you try to fix it?

  4. #4
    Join Date
    July 2002
    Location
    Germany
    Posts
    2,192
    Hi,

    the VIRTUALSERVER_IP is a server property which holds which IP the server is bound to listen on. Most servers don't bind to any specific IP, so this property is empty. Only a server that is configured to bind to a certain IP address has this value set.

    If you just want to know which IP the client used to connect to the server, use getConnectionVariableAsString with a flag of CONNECTION_SERVER_IP (6)
    You think my answer is stupid ? Read This:
    http://www.catb.org/~esr/faqs/smart-...ons.html#intro

    In a world without fences and walls - who needs windows and gates ?

  5. #5
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    => Moved back to Plugins (no bug)

  6. #6
    Join Date
    November 2015
    Posts
    3

    No CONNECTION_SERVER_IP for the Lua plugin

    I am unable to find a CONNECTION_SERVER_IP flag in the ts3defs.lua per http://forum.teamspeak.com/threads/6...457#post266457 Any help here?

  7. #7
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Code:
    local VirtualServerProperties = {
    -- ...
    VIRTUALSERVER_IP = 76,                                          -- internal use | contains only ONE binded ip
    -- ...
    }

  8. #8
    Join Date
    November 2015
    Posts
    3
    If you look at the thread:

    Hi,

    the VIRTUALSERVER_IP is a server property which holds which IP the server is bound to listen on. Most servers don't bind to any specific IP, so this property is empty. Only a server that is configured to bind to a certain IP address has this value set.

    If you just want to know which IP the client used to connect to the server, use getConnectionVariableAsString with a flag of CONNECTION_SERVER_IP (6)


    There is no CONNECTION_SERVER_IP in ts3defs.lua

  9. #9
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    I see, my bad, sorry.

    Just try the plain int value of 6.

    Code:
    local myid, error = ts3.getClientID(schid)
    local ip, error = ts3.getConnectionVariableAsString(schid, myid, 6)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: July 24th, 2014, 06:31 AM
  2. Replies: 2
    Last Post: October 6th, 2012, 02:49 AM
  3. 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
  •