Skip to content

OsaPL/GameQApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple GameQ Rest server

Installation:

  1. Run compose install (or just update)
  2. Generate autoload.php with composer dump-autoload -o (-o is for production, can be omitted)
  3. Profit!

Running:

Should work under any recent webserver, simplest way is to just use built in webserver for Php (7.3 for example) and just run php -S localhost:8888

Api calls:

GET(/api/gameq/) :

Returns state of servers, defined in server.json file (it has to be place in the same directory as index.php)

server.json file example:

[
  {
    "type": "minecraft",
    "host": "coolgamerguys.gov:25565"
  },
  {
    "type": "warsow",
    "host": "192.168.42.69:44400"
  }
]

POST(/api/gameq/) :

Return state of server/servers.

Example bodies (raw,json)

Single server

{
	"type":"tf2",
	"ip":"enemiespotted.io",
	"port":"27015"
}

Multiple servers

{
	"servers":
	[
		{
			"type":"minecraft",
			"ip":"coolgamerguys.gov,
			"port":"25565"
		},
		{
			"type":"warsow",
			"ip":"192.168.42.69",
			"port":"44400"
		}
	]
}

Dependencies:

  • Elementary framework (1.3 and up)
  • GameQ library (3.0 and up)

About

Simple GameQ REST Api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages