[Plugin] Photon Cloud

  • As far as I understand raise event data is always STRING.

    Is it possible to optimize event data with ints and bools?

  • fens

    Photon can send arbitrary js data (basic types, objects and arrays) but Construct2 does not support anything aside strings and numbers as far as I know.

    So we could send single number payload w/o conversion to string but this will make api more complicated while benefit is questionable.

  • ThePhotons

    Hey!

    How can I prevent someone using an older version of my game to join the server? Right now I just set the lobby name to the current version, so that you can only play with people from the current version (only temporary solution).

    What I want to do is, to:

    1. Tell the player, that his version is outdated and that he should update it.

    2. Prevent players from older version to join the game severs.

  • Hi 13spongg13,

    Use AppVersion field in Photon object properties. Only clients with the same AppVersion version can join the same room. Of course this does not prevent older client from joining. They will just play in separate rooms.

    To prevent joining, webhooks may be used (https://doc.photonengine.com/en-us/realtime/current/gameplay/web-extensions/webhooks) but this requires running your own http server implementing versioning logic (basically denying everything that is not of the latest version).

  • ThePhotons

    Thank you! Hm, sadly it isn't possible that easily. Would be nice be able to set and edit a version ID right where you create and edit your Photon Apps and then just check it with an event in Construct 2.

    Would something like that be possible in the future? It would make version checking and keeping the user up to date insanely easy!

  • 13spongg13

    We do not have any plans on version check.

    What can be easier than single http endpoint returning current version which client can read and check? You do not need webhooks in fact for this simple task.

  • ThePhotons

    Thank you, I solved it now probably the same way you just wrote. ^^

    I uploaded a html file via my Github webpage that just has the version number in it.

  • ThePhotons

    I'm sorry for spamming you, but I have another (short) question.

    Is it possible to run my online game as HTML5 somehwere? I did try it with GitHub, Itch.io and GameJolt and none of those seem to be able to connect to the server. The NWjs version is running fine.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • My game on itch.io has no problems.

  • Hm strange, could you maybe post a screenshot of the photon part in your event sheet? (only connection to server/lobby)

    It works fine with localhost and NWjs, but didn't work as html5 export yet.

  • 13spongg13

    What's in client log? Any errors?

  • ThePhotons

    Sadly there aren't any error. The game just does not connect to the server at all, neither on start of layout nor manually.

    I do use AJAX to reach a file via a weblink and that works fine, though. Going to make some testing the next days. Does the Java script minifier has anything to do with it? I didn't use it.

  • Photon can send arbitrary js data (basic types, objects and arrays) but Construct2 does not support anything aside strings and numbers as far as I know.

    So we could send single number payload w/o conversion to string but this will make api more complicated while benefit is questionable.

    Can I decrease data size if I use my own token split symbol (like "|") for data parameters?

    JSON uses a lot of extra symbols "{", "}", ";" for 1 dimension data.

    Oh, and it's very sad to send float like 2.7182928, because it's string.

  • fens

    You can use any serialization which produces strings. I think it's even possible to compress 2.7182928 to 4-5 symbols while preserving reasonable precision.

    As I wrote already, support for numbers will work only if the payload is a single number which is a rare case.

  • 13spongg13

    Even if there are no errors in logs, they are the only way for me to try to find out why client fails to connect.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)