Quantcast
Channel: JavaScript and TypeScript — Photon Engine
Viewing all 162 articles
Browse latest View live

Javascript SDK- Node.js - Error(Photon not defined.)

$
0
0
Javascript SDK- Node.js - Error(Photon not defined.)

Code snippet
var DemoLoadBalancing = /** @class */ (function (_super) {
return DemoLoadBalancing;
}(Photon.LoadBalancing.LoadBalancingClient)); <<<<<<<<<<<<<<<<<<<<<<< ERROR

'uniqueUserId: true' did not work

$
0
0
set:
createRoomOption uniqueUserId: true
but same UserId can join together still.

The project does not work when exporting

$
0
0
Hello
I need an early version of the Photon plugin (not chat) for Construct 2.
Thank you in advance for your help.

where is rejoin logic in JS sdk?

$
0
0
and how to make and debug the rejoin process?

Construct 3, webrpc not enabled

$
0
0
Using the demo-test app on my test of
http://www.kosmosaionios.com
It tells me that the webrpc is not enabled when I click test.
What is wrong with the demo or how do I fix this?
Thanks

Photon Realtime and Cocos Creator

How to keep connect when my Game playing an Ads?

$
0
0
cocoscreator
platform: android/ios
I found that when I play an ads, photon will disconnect.

What does this error log mean?

$
0
0
JS: [INFO]: [PhotonSDK] Join Random Room default_lobby 2 ...
ERROR: Error: Master: PhotonPeer[_send] - Operation 225 - failed, "isConnected" is false , "isClosing" is false !, location: src/project.js:24305:31

And Where can I handle it?

How to get online players count?

where to get cacert.pem?

$
0
0
facebook instance game need wss, how to use wss?
maybe i need a cacert.pem file? and where to get it? and how to use it?
ps: I use cocos creator game engine.

no where to set options like ' keepMasterConnection','lobbyName' when using connectToRegionMaster?

JS realtime communication with PUN

$
0
0
Hi, I'm building a cross platform app with PUN for Unity and the Javascript Realtime SDK for HTML5. I have successfully gotten the clients to see each other, create rooms, join sessions, etc. I have been unable to get my messaging to work in both directions. On the original PUN version, I used RPC calls to send Game Events. I was able to receive these via HandleEvent in Javascript. When attempting to reply from javascript, the only reference I could find in the SDK is for raiseEvent. I was also able to determine that 200 is the event code for RPC calls. Here is where I start to run into trouble... When the RPC is received, it fails the following NetworkingPeer.cs check: if (rpcData == null || !rpcData.ContainsKey((byte)0)) { Debug.LogError("Malformed RPC; this should never occur. Content: " + SupportClassPun.DictionaryToString(rpcData)); return; } The problem is that even when I send something as simple as: var data = {}; data[0] = 1; photonClient.raiseEventAll(200, data); //200 == RPC the 0 arrives as "0" and is != (byte)0 How am I supposed to send Events/RPCs to PUN from the Javascript Realtime SDK? Thanks! Rob

WebSockets - pass custom object to server on connect

$
0
0
Hi In c# it is possible to send custom object to server - initObject. However I cannot figure out how to make is work with ws. All objects - headers, initObject, userdata are null in CreatePeer's initRequest parameter

WebSocket connection failed

$
0
0
Hi, I've successfully written a multiplayer game using photon that runs at http://localhost:8080/. The intended platform is facebook instant games. Upon upload, the build no longer works due to Websocket issues. Upon attempting to connect, I receive the following error: Photon-Javascript_SDK.js:442 WebSocket connection to 'wss://ns.exitgames.com:..libversion=4.1.0.0' failed: Error in connection establishment: net::ERR_CONNECTION_RESET Photon-Javascript_SDK.js:192 PhotonApp: NameServer: PhotonPeer[_onError] - Connection error: Event {isTrusted: true, type: "error", target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …} How can I get this working in a secure connection?

can we establish photon connection with nodejs for sending room events

$
0
0
can we establish photon connection with nodejs for sending room events photon server is already connected with Unity

Wrong game/peerCount in Photon javascript?

$
0
0
Hi, I made a little node.js script to retrieve player and game counts from all region master servers. It seems fine but it doesn't show actual player numbers from the game. It seems it only counts the WebSocket client that is used to retrieve the information from Photon servers. Are WebSocket connections treated differently than UDP from the game? Or is this a bug? Or am I missing something? My node.js script: https://pastebin.com/ZTdnaBdy Logs output: [0] State: ConnectingToNameServer [0] ============ ws://ns.exitgames.com:9093/*APPID*7ea4?libversion=4.1.0.0 [0] ============ [0] State: ConnectedToNameServer [0] Photon regions: [0] eu : ws://***.exitgames.com:9090 [0] us : ws://***.exitgames.com:9090 [0] usw : ws://***.exitgames.com:9090 [0] cae : ws://***.exitgames.com:9090 [0] asia : ws://***.exitgames.com:9090 [0] jp : ws://***.exitgames.com:9090 [0] au : ws://***.exitgames.com:9090 [0] sa : ws://***.exitgames.com:9090 [0] in : ws://***.exitgames.com:9090 [0] ru : ws://***.exitgames.com:9090 [0] rue : ws://***.exitgames.com:9090 [0] kr : ws://***.exitgames.com:9090 [0] State: ConnectingToMasterserver [0] ============ ws://***.exitgames.com:9090/*APPID*?libversion=4.1.0.0 [0] ============ [0] appStats: 1 0 0 [0] eu (1/12) : games 0 master peers: 1 peers 0 [0] Connecting to: us [0] State: ConnectedToMaster [0] onLobbyStats: 1 [0] lobby: lobbyType: 0 peerCount: 0 gameCount: 0 Says peerCount 0 although my game client is running and connected.

NPM package for SDK?

$
0
0
I have been looking to see if there is a NPM package (for use with things like nodejs. I have not found one. Am I missing it? If not, there REALLY aught to be an npm package...

URL and AppVersion

$
0
0
What's the meaning of "URL" when creating my application, and what's the meaning of "AppVersion" in my SDK? And where's the basic introductory information that's supposed ot explain these Photon concepts? Thanks in advance.

What does "Nameserver peer error" mean?

$
0
0
I'm trying to connect to the service using my AppId in an SDK, but I'm getting the error message ""Nameserver peer error"" with the error code 3001. Why? What does this mean? There's no index of error codes anywhere on this site. Thanks in advance.

Photon JS Communication to PUN

$
0
0
Hello, I was wondering if there is an example on how to communicate locally between photon js SDK and PUN. The workflow I want to use is: Unity game starts -> sends message to javascript side JS side sends the login token -> PUN logs in with given token
Viewing all 162 articles
Browse latest View live