plan-player-analytics / Plan

Player Analytics plugin for Minecraft Server platforms - View player activity of your server with ease. :calendar:
https://www.spigotmc.org/resources/plan-player-analytics.32536/
GNU Lesser General Public License v3.0
869 stars 168 forks source link

Stand-alone web server #1991

Open KairuByte opened 3 years ago

KairuByte commented 3 years ago

A stand-alone web server would likely make more sense for large networks, than putting the web server on the proxy or choosing a random back end server.

Exporting data is quite expensive, so the current external web server option is not a good option for large sets of data.

Ideally, such a change would grant the ability to simply run plan directly within Java, stripping out the need for a minecraft server completely.

cody-quinn commented 3 years ago

I agree. Being able to host Plan on a dedicated web server would be nice.

rymiel commented 3 years ago

Realistically, should #1623 and #1965 be solved before tackling this thing? Perhaps even #1987

AuroraLS3 commented 3 years ago

@rymiel The features of the linked 3 tickets are independent from the runtime environment.

While I haven't refined this issue to write down what needs to be done, I think the easiest approach is to have a standalone Plan instance take a read-only identity of a server in the MySQL database - be that the proxy or a game server. ServerInfoFile.yml could be used as a way to choose what the standalone Plan instance reads.

The abstraction level is sufficient to replace where Plan is running on, so it should be possible to run Plan with a Main class as long as all the things have implementations - even if no-op (ListenerSystem for example won't have anything to do but it's still expected by Dagger).

A lot of assumptions break down during this and can cause unexpected things, since two Plan instances identifying as the same one is not something anticipated when coding. I'll try to include those when I eventually refine what needs to be done for this.

AuroraLS3 commented 3 years ago

TODO

If lucky, that's all that's needed and Plan will just chug along as if it was the specified server without writing any data. It is important that the Server comes from database, expecially the Server#proxy since that is used for determining whether to show network or server page.

AnttiMK commented 3 years ago

A couple of additional ideas for implementation:

ServerInfo - should read the database for the server specified in ServerInfoFile.yml - Don't enable if the file is not present. Create the configuration folder with a Install instructions that say to copy ServerInfoFile.yml and config.yml from the other server.

On first start, we could query the user for MySQL connection details directly in the console, and when (if) the connection succeeds, query the user about choosing a server, maybe with the following message:

Please choose the ID of the server you'd like Plan to show data for. 
A proxy server (Bungee etc.) is preferred when running in a network
environment with Plan installed on the proxy AND the backend servers.
----------------------------------
ID - Server type - Server name - UUID

1 (preferred) - Bungeecord - Awesome Minecraft Network - a33361f4-4338-4921-b127-7f36c5f35504
2 - Spigot - Survival - 9cb34504-8e47-4c09-b924-76d57ea848b4
3 - etc...

ID of server to show data for: <wait for input>

This would lessen the need to touch config files, and would make for a smoother a) "install" experience b) console application.

AuroraLS3 commented 2 years ago

Did some work on this on standalone-mode branch, but it is still pretty unusable since it thinks it's a game server. Enables fine though :)

RareScrap commented 10 months ago

Any progress on this? This feature would be really sweet when it comes to deal with multiple server analytics hidden by Velocity.

AuroraLS3 commented 10 months ago

Haven't had the time to progress this. It's pretty high up though since I don't want too many in-progress branches

TobiasGrether commented 10 months ago

Yeah this would be a lovely feature. Just a docker image with a REST API to post the data points to, plus a database to connect it to would be optimal.

TobiasGrether commented 10 months ago

Note from discord: It would make sense to add support for environment variable configuration. Standalone versions of plan might often be run in a docker container where a config by env variables will be easier than by file.

Gizmo0320 commented 2 weeks ago

Is there any update on this?