DynMapPMMP icon indicating copy to clipboard operation
DynMapPMMP copied to clipboard

Website <-> Plugin Connection

Open Sandertv opened this issue 7 years ago • 14 comments

The first big task we'll have to work on is the main connection between the website and the plugin.

Step 1 The client enters their server on the website, with the server address and the server port. This could be returned as base64_encode ( serverAddress ':' serverPort). The web page should then return that string to the user as their personal server key. This string should also be saved in order to check if a request is valid later.

Step 2 The client installs the DynMapPMMP plugin on their server, and configures the config.yml with the personal server key given above.

Step 3 The plugin should do some basic checks whether the given personal server key is valid, and attempt to make a connection to the website using sockets. If no connection could be made, the plugin should be disabled.

Step 4 When the website receives a socket, the website should validate the personal server key given. If the personal server key is one that has been saved, the request is valid; It should create a new web page which can then be further used in the future.

Sandertv avatar Sep 10 '17 12:09 Sandertv

@HimbeersaftLP feel free to push straight to the master branch if you're making changes gradually by the way, it makes things a bit easier.

Sandertv avatar Sep 10 '17 12:09 Sandertv

Self-hosted website or? collaborate more.

I may be able to assist fully on this project.

xZeroMCPE avatar Sep 13 '17 05:09 xZeroMCPE

I don't have the complete image yet, I think it's best to host the website as a single instance so the end user has to do like nothing to get their map working. I don't have a lot of experience with this though, so I'm not sure what is the best approach yet.

Sandertv avatar Sep 13 '17 05:09 Sandertv

It's mostly the website part that I'm not great at. Basic CSS + HTML and a bit of Javascript is how far I get with that, some help on that would be greatly appreciated of course. HimbeersaftLP is helping with that as well.

Sandertv avatar Sep 13 '17 06:09 Sandertv

@Sandertv Oh so like this:

capture

Or did I comprehend it wrong?

xZeroMCPE avatar Sep 13 '17 15:09 xZeroMCPE

I'm not really sure if it should be hosted locally per person or hosted on one main website yet.

Sandertv avatar Sep 13 '17 15:09 Sandertv

Each has their cons and pros.

xZeroMCPE avatar Sep 13 '17 15:09 xZeroMCPE

True, hosted locally is a lot easier for us, we won't have to store a lot, but hosting one instance is easier for the end user.

Sandertv avatar Sep 13 '17 16:09 Sandertv

True, therefore, the plugin can come with its own web server. Just like DynMap does. Players can navigate to it through a certain port ex: example-ip:2500 etc (ports, of course, can be customized through config).

xZeroMCPE avatar Sep 13 '17 19:09 xZeroMCPE

Yeah exactly, that does make life a lot easier as we can separate the actual website from the dynamic map.

Sandertv avatar Sep 13 '17 19:09 Sandertv

I'll be pushing a rather large commit in a second which'll have the basic code for creating a proper map with a way to do it even when chunks aren't loaded.

Sandertv avatar Sep 13 '17 19:09 Sandertv

Alright.

xZeroMCPE avatar Sep 13 '17 20:09 xZeroMCPE

Okay I personally think having the client's machine host the DynMap page is the best idea. That way we won't have to worry about running out of storage space for anything, and we could even have the info website hosted by GitHub if we'd do so.

Sandertv avatar Sep 14 '17 14:09 Sandertv

Yeah definitely.

xZeroMCPE avatar Sep 14 '17 14:09 xZeroMCPE