Austinb / GameQ

A PHP Gameserver Status Query Library
https://austinb.github.io/GameQ/
GNU Lesser General Public License v3.0
403 stars 134 forks source link

Starbound Map Name #194

Closed Ruok2bu closed 10 years ago

Ruok2bu commented 10 years ago

Every visited world is being displayed in the map name and its making it insanely long (since a whole universe is explorable). The world names also aren't that important since they are random. Can you apply the same fix you did for the missing JC2MP map to Starbound?

https://raw.githubusercontent.com/Austinb/GameQ/cadcbf1cb221e74c35ad21f433454511b86e0808/gameq/protocols/jc2.php

It would be better if all the map name simply said: Universe

Verox- commented 10 years ago

I would say the system is working as intended; it gets what the server reports and outputs it to you, whether you choose to use that information, modifiy it before using or disregard it is up to you. While it may not be useful for you to have every world visited it could still be useful to someone else.

Ruok2bu commented 10 years ago

Well, i figured it out. Here's the code if anyone else wants to use it:

After Line 53 where it says: protected $packet_mode = self::PACKET_MODE_LINEAR;

Add:

protected function process_details() { // Process the server details first $results = parent::process_details();

    // Remove map name
    if(preg_match('/.+$/', trim($results['map']), $m))
    {

        // Change map name
        $results['map'] = 'Universe';

        unset($m);
    }

    return $results;
}