Forum

Results 1 to 9 of 9
  1. #1
    Join Date
    October 2014
    Posts
    60

    Send extra information

    Not strictly a Teamspeak question but I'm looking for a way to send extra info over Teamspeak so think this is the right place.

    I've built a client and server based on the C# SDK examples.

    All is working great.

    My project is to replicate an aircraft radio for use with flight simulators.

    One of the things I'd like to do is to adjust the audio quality the further away a client gets from another client.

    I have mostly achieved this and I can calculate how far clients are away from each other by using their latitude and longitude, great.

    The question is...
    I can't think of a way to get a clients lat lon when they join the server.
    I would also need it again every few seconds as they move closer or further away.

    Has anybody any ideas?

  2. #2
    Join Date
    August 2013
    Location
    Germany
    Posts
    541
    Do you mean their IRL lat, lon? You can get that from their IP though it's not very accurate. (example: http://ip-api.com/json/8.8.8.8)

    If you're talking about their ingame lat, lon you probably want to go with metadata or plugincmd

  3. #3
    Join Date
    October 2014
    Posts
    60
    Thanks Bluscream.

    The lat lon is fictional as it comes from a simulator.
    In any case that part is sorted, I have that data.

    The part I am stuck on is each client sending their lat lon (or postion) to the other clients connected to the same channel.

    I've already written the code to calculate how far a client is away from the others.
    I just need to get the other positions somehow.

    For example:
    If everybody's client.nickname was their position.
    That gets sent to all clients in the same channel and I would be able to get it.

    I obviously wouldn't use nickname, I was just trying to explain.

  4. #4
    Join Date
    August 2013
    Location
    Germany
    Posts
    541

  5. #5
    Join Date
    October 2014
    Posts
    60
    Having a quick look, that is totally beyond my skills.
    It looks as if it gets positional data as to where a client is (in front, behind, left or right)?

    I'm just looking for a double (or string) to be sent from one client to the others.

    My thinking is I could then use it in a for each statement and base the audio quality on the result from each client.
    Similar to is client muted.

  6. #6
    Join Date
    September 2012
    Posts
    6,080
    Ignore all of that, it's C++ and a different SDK (that code is using the SDK for writing plugins for the official client).

    You can use Client.MetaData and set it to any value and then use it elsewhere. It's published to other clients (that can see the client) through the server.

    The following code is untested but should give you an idea.
    Code:
    connection.Self.MetaData = String.Format("{0},{1}", game.getLat(), game.getLon()); // Store game coordinates of your own client.
    
    // print coordinates of visible clients
    foreach (Client cl in connection.AllClients) {
        Console.WriteLine("Client {0} is at position {1}", cl.Nickname, cl.MetaData);
    }
    Note that in this case each client sets their own position. Depending on your needs this may not be the best choice w/ regards to cheating.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  7. #7
    Join Date
    October 2014
    Posts
    60
    Thanks Chris.
    That's something I understand and does look like what I'm after.
    I'll give it a go later.
    Will metadata be sent to other clients on change?

    For example if I were to set it every 5 seconds, would the other clients receive the change every 5 seconds?
    Or would I need to check if it's changed every 5 seconds?

  8. #8
    Join Date
    September 2012
    Posts
    6,080
    The server takes care of updating other clients when it changes. It's also always available for all clients in view.
    No guarantees about the timing though, but in the quick manual test I did using the Client Example, the second client was displaying the updated meta data after the server acknowledged setting them.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  9. #9
    Join Date
    October 2014
    Posts
    60
    Well I had chance to try this over the weekend.
    MetaData was exactly what I was looking for.

    You've helped me in the past Chris, so thank you once again.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do I add extra server channels?
    By Daqtar in forum General Questions
    Replies: 1
    Last Post: August 3rd, 2012, 11:56 PM
  2. TS3 extra or plugin question?
    By hthammond in forum General Questions
    Replies: 2
    Last Post: October 28th, 2010, 05:49 PM
  3. teamspeak extra
    By justisero in forum General Questions
    Replies: 1
    Last Post: May 14th, 2010, 02:57 PM

Posting Permissions

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