-
Notifications
You must be signed in to change notification settings - Fork 94
NOTE:: The following API details will only work with the current Master files from GitHub. These changes will be included in the next 3.0.11 master release, but for now, use Git. (https://github.com/devryan/GamePanelX-V3)
$postfields["key"] = $api_key; $postfields["class"] = "servers"; $postfields["action"] = "create"; $postfields["game"] = "cs_s"; # Internal gamepanelx game name $postfields["username"] = "newuser123"; # New user to be created $postfields["email"] = "newuseremail123@email.com"; # New user's email $postfields["password"] = "somepass123"; # New pass ... $postfields["first_name"] = "Test"; $postfields["last_name"] = "User"; $postfields["slots"] = "16"; # Max players/slots $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $data = curl_exec($ch); curl_close($ch);
Current classes that can be specified are "servers" and "users". More will be added later.
To create a server using the API, make an HTTP call to your server like so:
http://'''<domain.com></domain.com>'''/gpx/api/api.php?key='''<gpx></gpx>'''&class=servers&action=create&game='''cs_s'''&username=newguy1&password=pass12345&email=newguy@test.com&first_name=New&last_name=Guy&slots=16
This will create a server, and new user named "newguy1" with the password "pass12345", with the server type being "cs_s" (internal gpx name), which is Counter-Strike: Source. This assumes you already have a cs:s template created successfully. This also specifies a 16 slot/user/player server.
Creates a new server. If you specify a username that doesn't exist, it will be created. A template must exist for this game and be set to Default.
Accepts: id, game, slots, username, password, email, first_name, last_name
How: &class=servers&action=create&game=cs_s&slots=16&username=newguy1&password=pass12345&email=newguy@test.com&first_name=New&last_name=Guy
Delete a server.
Accepts: id
How: &class=servers&action=delete&id=1
Restart a server.
Accepts: id
How: &class=servers&action=restart&id=1
Stop a server.
Accepts: id
How: &class=servers&action=stop&id=1
Updates a server to the latest.
Accepts: id
How: &class=servers&action=update&id=1
Allows you to send a Screen command to a running server.
Accepts: id, cmd
How: &class=servers&action=sendcmd&id=1&cmd=status
Gives you JSON output with lots of server details.
Accepts: id
How: &class=servers&action=getinfo&id=1
Creates a new user account.
Accepts: username, password, email, first_name, last_name
How: &class=users&action=create&username=newguy1&password=pass12345&email=newguy@test.com&first_name=New&last_name=Guy
Deletes a user account. Will fail if there are any servers associated with the account.
Accepts: id
How: &class=users&action=delete&id=1
Update details of a user account.
Accepts: id, username, password, email, first_name, last_name, language, theme
How: &class=users&action=update&id=1&username=newguy1&password=pass12345&email=newguy@test.com&first_name=New&last_name=Guy&language=english&theme=default