Skip to content

Journeymap support #4

Closed
PatchyKnowly opened this Issue · 5 comments

2 participants

@PatchyKnowly

Journeymap doesn't support WorldInfo for some reason, despite having done so historically (or perhaps it was an intended feature that never made it, or was dropped because WorldInfo wasn't maintained). Its current multiworld support is based on Journeymap-Server.

The current interaction process with Journeymap-Server is:
1. Player joins the server/changes world
2. Journeymap-Server sends a string on the channel 'world_info' to the client
3. Journeymap accepts the string and appends it to the name of the data folder for the server

This doesn't work with WorldInfo because
1. WorldInfo requires the client to request before sending anything
2. WorldInfo responds on the channel 'world_id'

I can see several possible solutions, some more work than others:

  • Have WorldInfo broadcast to any client that connects/changes world on 'world_info'
    - easy but probably not ideal
  • Convince techbrew/Mysticdrew to add in proper worldinfo support to Journeymap
    - might be difficult, but I can try
  • Get someone who knows how to make client mods to make something that sends the request, and modify WorldInfo to respond additionally on 'world_info'
    - probably fairly straightforward plugin-wise, and shouldn't take someone who knows how to write mods very long at all
  • Get someone who knows how to make client mods to make something that sends the request and translates the response from 'world_id' to 'world_info'
    - might be trickier to make, if it's actually possible at all.
@PatchyKnowly

On closer examination, even though I was told otherwise, I believe journeymap IS sending a request packet, despite journeymap-server not caring and broadcasting anyway.

[21:13:40 INFO]: packet recieved world_info
[21:13:40 INFO]: worldid request packet

It does appear to be on the wrong channel, however.

I should be seeing a response ("Message Recieved but was not the same channel.") from the server in my chat according to my limited understanding of the plugin, but I don't see it.

That aside, would it be possible to have the plugin respond to messages on 'world_info', too?

@ProgrammerDan

Hah, how silly.

It might be. I'll check it out tonight, thanks for investigating!

@PatchyKnowly

Ok, I've done a bit of digging, and I guess I'm working out how Java actually works a tiny bit. In regards to my previous post, I'm not seeing a response regarding journeymap talking on the wrong channel because inform-player is set to false.

As stated, I don't really know Java but I think all that'd need doing is:

change the variable 'channel' into an array, and read the entire config line 'plugin-channel' into it.
in register: register all strings in 'channel' as plugin channels
in unregister: unregister all strings in 'channel' as plugin channels
in onPluginMessageReceived: check against all strings in 'channel' for the validity check
in onPluginMessageReceived: save the channel they communicated on as the variable 'pchannel'
in sendData: message the client on the channel 'pchannel' rather than 'channel'

Then you could just have config line 'plugin-channel' (maybe change it to plugin-channels) be a list of channels separated by spaces, making the plugin reasonably flexible.

Hell I could probably do it myself if I knew how to into Java variables.

@ProgrammerDan

If you're feeling brave, I'd be happy to review any pull requests :D

@PatchyKnowly

Supposedly Gordon's fixed it in in #5; tested it on my server and it works fine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.