MyBB Community Forums

Full Version: Servers board
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Supryk,

It works wonderfully!

Here is the server list on it's own page:
[attachment=31559]
http://www.phoenixusc.com/board/serversboard.php

. . . and also on the board index page:
http://www.phoenixusc.com/board/index.php

Pagination would be a useful feature and I will PM you here soon. I also have a question on using the protocol script if that is something you can help on.

Thank you for the support and great results! Big Grin
- Rich -
enjoy that Smile
Supryk,

You rock buddy! Here is an image of my indie game with 'Online' status in Servers Boards index. Using the minequery protocol for now but so cool to see my server reporting it's status. Big Grin
[attachment=31564]

I could not have got it going without your help. Thank you!

- Rich -
Hi,

I am trying to write a custom protocol for this plugin. I'm using the minequery protocol as a template. I need to form valid JSON string. Would the following be a valid JSON string:

{"serverPort":24960,"playerCount":1,"maxPlayers":20,"playerList":[{"name":"me"}]}

My error is this section of code:

	protected function process_status()
	{
		// Make sure we have a valid response
		if(!$this->hasValidResponse(self::PACKET_STATUS))
		{
			return array();
		}

		// The response should be a single string so just combine all the packets into a single string
		$response = implode('', $this->packets_response[self::PACKET_STATUS]);

		// Check to see if this is valid JSON.
		if(($data = json_decode($response)) === NULL)
		{
			throw new GameQ_ProtocolsException('Unable to decode the JSON data for Minequery');
			return FALSE;
		}

		// Set the result to a new result instance
		$result = new GameQ_Result();

		// Server is always dedicated
		$result->add('dedicated', TRUE);

		// Add the address and port info
		$result->add('serverport', $data->serverPort);

		$result->add('numplayers', $data->playerCount);
		$result->add('maxplayers', $data->maxPlayers);
		$result->add('hostname', $data->hostName);

		// Do the players
		foreach($data->playerList AS $i => $name)
		{
			$result->addPlayer('name', $name);
		}

        return $result->fetch();
	}

If I replace " $result->addPlayer('name', $name); " with " $result->addPlayer('name', "me"); " it will work and list "me" as a player. Running the code as is gives me a object conversion error ( could not be convert to string).

Any ideas?
- Rich -
Hi,

I have never got around to really learning PHP but I did get a handle on it a bit last night. It turns out that the minequery example has an error. It is (as I understand it) not using a data type but instead uses a class. At any rate here is the correction to the above code:

This:
        // Do the players
        foreach($data->playerList AS $i => $name)
        {
            $result->addPlayer('name', $name);
        }

Should be like this:
        // Do the players
        foreach($data->playerList AS $i => $name)
        {
            $result->addPlayer('name', $name->name);
        }
        // Where name is the 'key' and the value is extracted from the data type object

This fixes the problem and allows me to add player names. I will post a simply query protocol for those who want to support their own server protocol as soon as I have it ready.

- Rich -
Hi,

Thank you for 2.9.4 ! Working great.
Just Awesome.

- Rich -
Update to 2.9.4

Naprawilem problem z cache w bazie danych
I added a list of servers yo yoursite.comserversboard.php
I added a check if in the link to subpage id is correct
I added a button to join to server buddy list

reupload all files and reinstall

GL&HF
Quote:Naprawilem problem z cache w bazie danych
Translates to: I fixed a problem with the cache database Smile

And to be clear he:
Added a list of servers on it's own page. Just load 'serversboard.php' in the MyBB root directory. It will display the servers board list of servers (normally on board index page) on its own page. A very useful feature.

Here is an example of that on my site.

Thanks Supryk for supporting and enhancing this plugin. Servers boards really does a good job and your support over the last week (helping me personally) has been phenomenal.

- Rich -
Is there anyway to add ETS2MP Game servers on this? There's only 1 server at the moment.
Hi,

you can make your own protocol but you would have to know the server listing protocol the game is using. You would also have to add the new protocol to the servers board plugin.

I wrote a custom protocol by modifying one of the examples so it is doable.

If your interested you can start here the GameQ Githud.

You can have a look at the GameQ protocols in the 'inc/plugins/serversboards/gameq/protocols/'

- V -