Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 6 of 6
  1. #1
    Join Date
    May 2013
    Posts
    4

    Question Error when trying to change the maximum clients allowed in the virtual server

    Hello, I'm trying to dynamically change the amount of slots that clients are allowed in in each virtual server for the game I'm working on. We are currently live. I'm working with a test server in order to make necessary changes.

    My plan to set in motion is that whenever someone enters the virtual server, then the following function will be called and an extra slot will be created in case someone else tries to join. Once I get this working I will set up a similar function to remove unused slots.

    Code:
    static void addClientSlot(uint64 serverID){
    
    	unsigned int error; // error checking
    
    	int theMaxClients;  // Holds the number of client slots in this virtual server
    
            // This function works flawlessly by passing in a reference to theMaxClients I get the max amount
            // of clients allowed in this virtual server
    	ts3server_getVirtualServerVariableAsInt(serverID, VIRTUALSERVER_MAXCLIENTS, &theMaxClients);
    
            // Print the number of max clients
    	cout << "The Max clients are: " << theMaxClients << endl;
    
    	cout << "Adding 1 to the list" << endl;
    	
            // Add one to the max Clients (as this function is called when someone joins the server)
    	theMaxClients++;
    
            // This is where the code breaks! In theory by passing theMaxClients variable, which has been incremented 
            // by one, the max clients should go up by one (I would later implement a check to see how high this is
            // number is getting) The server instead crashes and I get the following error:
            // 2013-05-09 21:17:58.424079|CRITICAL|Variables       |   | isValidItem() on unregistered variable | Index:5
    	if((error = ts3server_setVirtualServerVariableAsInt(serverID, VIRTUALSERVER_MAXCLIENTS, theMaxClients)) != ERROR_ok)
    	{
    		printf("Error setting the new capacity: %d\n\n", error);
    		return;
    	}
    
    	ts3server_flushVirtualServerVariable(serverID);   // Flush value
            
            // just to prove that it's working properly (which it isn't)
            ts3server_getVirtualServerVariableAsInt(serverID, VIRTUALSERVER_MAXCLIENTS, &theMaxClients);
    
    	cout << "The Max clients are now: " << theMaxClients << endl;
    }
    I can't seem to find any information on this error, Hopefully someone here can shed some light on my situation.

    I am using c++, and working with Visual Studio 2010 Please let me know if you need any more information, and thank you in advance!

  2. #2
    Join Date
    September 2012
    Posts
    6,079
    What you are trying to do is called DSA and is strictly forbidden! Your License may be suspended because of it.

    How often do you get the crash?
    Can you reproduce it 100% of the time?
    Also do you get any error on the function calls? If so which one?

  3. #3
    Join Date
    May 2013
    Posts
    4
    The crash is 100% of the time, the only time it doesn't crash is if the function call gets an invalid ID, in which case it gives off the error saying that the virtual server doesn't exist. However if the virtual Server ID is valid the server will crash every time, and give off the error that I wrote in my original post:

    2013-05-09 21:17:58.424079|CRITICAL|Variables | | isValidItem() on unregistered variable | Index:5

    As far as it being forbidden, that's good to know I will look into other strategies of getting my desired results. However It would still be nice to know what is happening just for the sake of learning. Also What exactly is DSA?

    Just so we're clear I'm trying to make it so that we can have all of our virtual servers open at all times, but not have all of the slots open. If that is something that isn't allowed, then would it be safe to assume that I should go the route of deleting and creating the virtual servers on the fly?
    Last edited by jvk2117; May 13th, 2013 at 05:53 PM.

  4. #4
    Join Date
    September 2012
    Posts
    6,079
    Dynamic Slot Allocation

    You can create / delete or start / stop servers, but you may not change the slots of a server dynamically as needed.
    Last edited by Chris; May 16th, 2013 at 09:11 AM.

  5. #5
    Join Date
    May 2013
    Posts
    4
    I figured that's what it meant... Ok I will be taking another approach

  6. #6
    Join Date
    May 2013
    Posts
    4
    Quick question:

    Lets say I create Two Virtual Servers that can hold 1000 slots (just for the sake of the question). I create one at a time. Before I create the second one, I stop the first, then create the second, then stop it. I then set it up so that when clients attempt to enter one of these virtual servers The server will turn back on. For the month only one server is ever on at one time, would I get billed for 1000 slots since in this case only 1 server was ever on at a time, or would I get billed for 2000 slots since I allocated 2000 slots?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Maximum Allowed Icon Size is 0 kb
    By Stiicker in forum Permission System
    Replies: 6
    Last Post: January 18th, 2014, 08:39 AM
  2. Replies: 2
    Last Post: March 5th, 2013, 06:34 PM
  3. [Solved] Maximum quantity of clients on a server
    By =RAF=Coma in forum Server Support
    Replies: 4
    Last Post: July 19th, 2010, 02:21 PM
  4. How to disable the ability to change allowed server-slots?
    By formtapez in forum Permission System
    Replies: 4
    Last Post: April 28th, 2010, 09:16 PM

Tags for this Thread

Posting Permissions

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