[Plugin] Photon Cloud

From the Asset Store
Adventure Quiz interactive (Questions and answers via Json)
  • aminhanifm

    You need to get the current time t0 (not sure what is the best way to do so in ConstructX), send an event, receive it, get the current time again and subtract t0 from it. The result will be round trip time, that is the time required to transmit the signal to the server and back.

  • aminhanifm

    You need to get the current time t0 (not sure what is the best way to do so in ConstructX), send an event, receive it, get the current time again and subtract t0 from it. The result will be round trip time, that is the time required to transmit the signal to the server and back.

    So i need to make variable "t0" then set this variable to my current time every tick, then send an event with t0 data to my own actor for every second, after getting it i need to substract t0 to photon.eventdata ?

  • aminhanifm

    Sending t0 in event is even better idea than storing it locally. Then you don't confuse different pings running in parallel.

    But you do not need to do anything each tick or second. Check ping whenever you need it. Maybe once per room join. Send an event with the current time to yourself. When the event received, subtract the time stored in the event from the current time. The result is rtt or ping.

  • aminhanifm

    Sending t0 in event is even better idea than storing it locally. Then you don't confuse different pings running in parallel.

    But you do not need to do anything each tick or second. Check ping whenever you need it. Maybe once per room join. Send an event with the current time to yourself. When the event received, subtract the time stored in the event from the current time. The result is rtt or ping.

    Ahh i'm gonna try it soon, thanks anyway :D

  • Hi again!

    Does anyone know how to disconnect from servers without errors? Im tryin to allow player to go back to title screen and disconnect. Leave game works but not disconnect. Thannnks

  • BronzeBeardGames

    Photon.Disconnect action disconnects from all servers.

  • ThePhotons I have used that but it causes console errors, ill try print them out later. Is there a special way to use it?

  • ThePhotons Hi! Regarding disconnect errors:

    Game connects to server >

    Client: Game: myActor: b {name: "", actorNr: 1, isLocal: true, customProperties: {…}, suspended: false, …}

    Client: State: ConnectedToGameserver -> Joined

    In game I have one button that when clicked calls Photon>disconnect from all servers. When clicked displays the following errors:

    "photon-javascript_sdk.min.js:7 Uncaught (in promise) Error: Client: Game: [203] PhotonPeer[_send] - Operation 253 - failed, "isConnected" is true , "isClosing" is true !"

    and

    "Uncaught Error: Client: Game: [203] PhotonPeer[_send] - Operation 253 - failed, "isConnected" is false , "isClosing" is false !"

  • ThePhotons Resolved...My bad, I had an 'on actor leave' event trying to raise a Photon game Event on the non existing (leaving) player!

    Hoping my mistakes can help others! :D

  • BronzeBeardGames

    I have used that but it causes console errors, ill try print them out later. Is there a special way to use it?

    I don't have an idea which errors you are talking about.

  • hi there!

    How can I divide rooms for different levels of players. For example I don't want hardcore player to play agains new players.

    Could I set lobby name while creating rooms, and set lobby name as level1, level2, level3 for different levels. Then player find random room by lobby name based on their own level.

    thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • by the way, what is the "lobby name" means when creating or finding random rooms?

  • hi kentoy

    Please read matchmaking documentation doc.photonengine.com/en-us/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby

    It also has detailed lobby definition.

  • hi kentoy

    Please read matchmaking documentation doc.photonengine.com/en-us/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby

    It also has detailed lobby definition.

    hi,

    in the Photon document:

    If you are trying to join a random room, make sure to choose the same lobby (name and type) used when creating it.

    So is that means if player join rooms with different lobby names using Photon C2 plugin, they can not match each others?

    thanks!

  • kentoy

    So is that means if player join rooms with different lobby names using Photon C2 plugin, they can not match each others?

    Correct. Players from different lobbies can't join the same room.

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