Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Mar 25, 2019 5:08 am

All times are UTC




Post new topic  Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Jan 10, 2019 9:17 am 
Offline
Engineer
Engineer

Joined: Tue Sep 02, 2008 7:45 am
Posts: 21
Is there a way to get company rating via the server admin port?
I'm talking about the rating shown in Company League Table.


Top
   
PostPosted: Thu Jan 10, 2019 9:14 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 145
Location: Czech Republic
Hezkore wrote:
Is there a way to get company rating via the server admin port?
I'm talking about the rating shown in Company League Table.


There is an Ottd stats project that stores company information into the SQL database
https://dev.openttdcoop.org/projects/ottdstats/

_________________
Owner and admin of servers:
Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My newGRFs: ---


Top
   
PostPosted: Thu Jan 10, 2019 9:35 pm 
Offline
Engineer
Engineer

Joined: Tue Sep 02, 2008 7:45 am
Posts: 21
Hmm, alright.
I'm not really finding any proper information about how they're getting league table information though.
I basically want to know what company is leading (according to the Company League Table found in-game).


Top
   
PostPosted: Thu Jan 10, 2019 9:53 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 145
Location: Czech Republic
Easier it is probably through the "companies" console command. But GSCompany also has some interesting commands: https://nogo.openttd.org/api/1.8.0/classGSCompany.html

_________________
Owner and admin of servers:
Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My newGRFs: ---


Top
   
PostPosted: Thu Jan 10, 2019 10:02 pm 
Offline
Engineer
Engineer

Joined: Tue Sep 02, 2008 7:45 am
Posts: 21
agentw4b wrote:
Easier it is probably through the "companies" console command.

Sadly the `companies` command does not show the rating of the company, only ID and some economy stats that I'm already able to track.


Top
   
PostPosted: Thu Jan 10, 2019 10:22 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 145
Location: Czech Republic
Hezkore wrote:
agentw4b wrote:
Easier it is probably through the "companies" console command.

Sadly the `companies` command does not show the rating of the company, only ID and some economy stats that I'm already able to track.


static int32 GetQuarterlyPerformanceRating (CompanyID company, uint32 quarter)
Get the performance rating of the given company in the given quarter.
---------------------------------------------------------------------------------------------------
GSCompany.GetQuarterlyPerformanceRating (company, quarter);

_________________
Owner and admin of servers:
Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My newGRFs: ---


Top
   
PostPosted: Thu Jan 10, 2019 11:09 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9215
Location: Sol d
agentw4b wrote:
Hezkore wrote:
agentw4b wrote:
Easier it is probably through the "companies" console command.

Sadly the `companies` command does not show the rating of the company, only ID and some economy stats that I'm already able to track.


static int32 GetQuarterlyPerformanceRating (CompanyID company, uint32 quarter)
Get the performance rating of the given company in the given quarter.
---------------------------------------------------------------------------------------------------
GSCompany.GetQuarterlyPerformanceRating (company, quarter);


Correct me, if I'm not well informed here: To me that means it's available to GameScripts. But the GameScript can make it in turn available to the admin port via GSAdmin::Send.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Thu Jan 10, 2019 11:13 pm 
Offline
Engineer
Engineer

Joined: Tue Sep 02, 2008 7:45 am
Posts: 21
That's what I believe and I'm trying to figure out...
But the server wants a JSON structure of the code, not just raw game script.
So I'm guessing it's related to `ServerGS`, but I don't think you need the ServerGS script anymore.
I believe the server just has it built-in these days.

I'm trying to send stuff like:
Code:
{
    "action" = "ping",
    "number" = 0
}

Which I found via the ServerGS readme - https://dev.openttdcoop.org/projects/gs-server/repository/entry/readme.txt#L44
But the server never responds with anything other than basically saying "I got this piece of code" in the console.
There's never any reply or even error message.

I've tried installing the ServerGS script, but there's no error or reply anyways.


Top
   
PostPosted: Thu Jan 10, 2019 11:47 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7301
after downloading ServerGS, you must enable it in openttd.cfg, and then start a new game (or upload a savegame where it has been activated in your client)

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
PostPosted: Thu Jan 10, 2019 11:53 pm 
Offline
Engineer
Engineer

Joined: Tue Sep 02, 2008 7:45 am
Posts: 21
I downloaded the repo from https://dev.openttdcoop.org/projects/gs-server/repository
Extracted into `openttd/game/servergs`
Edited the `openttd.cfg` (which btw should be called `.ini`):
Code:
[game_scripts]
ServerGS =
Restarted my server.
Joined my server and called `rcon _PASS_ newgame`
And sent an `AdminGamescript` packet to the server.
But as always, the reply is just:
Code:
Packet: ServerConsole
message: [admin] GameScript JSON from '_USER_' (_VER_): '{"action"="ping","number"=0}'
origin: net
No reply from the gamescript, no error, no result.


Top
   
PostPosted: Sun Jan 13, 2019 6:54 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Fri Apr 14, 2017 3:51 pm
Posts: 145
Location: Czech Republic
I did not try to use this, but:

ServerGS 2 is downloable from oficial Bananas server.

ServerGS 3 is here:

viewtopic.php?f=65&t=68828

_________________
Owner and admin of servers:
Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
My newGRFs: ---


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.