Quantcast
Channel: Photon Server — Photon Engine
Viewing all 1557 articles
Browse latest View live

Object has been disconnected or does not exist at the server.

$
0
0
Hey, I am using photon server sdk and I am lately been seeing a lot of "Object 'some long guid' has been disconnected or does not exist at the server." errors. These are happening in my server code with debugger attached. They seem to be happening randomly and at random locations in the code.

I am not sure how to debug them or what may be causing this. Any suggestions?

Move from Photon Server to Enterprise Cloud?

$
0
0
Hi, we plan to develop or game server logic in our own server Photon Server SDK. Then we will eventually want to move to the Enterprise Cloud plan, so that we can host our erver-side logic in your servers?

Is this a valid workflow? Is the transition easy / transparent or it involves redesigning or re-coding the game logic server in anyway?

Thanks.

Plugin, checking users in the Lobby/cutting connection in lobby

$
0
0
We're writing a plugin for the photon server and I'm having trouble understanding how to check information on joined players/peers while they are in the lobby before they join a game/room. I don't see a callback in the photon plugin sections of the website related to things like OnConnectedToMasterServer kind of stuff. We would also like to allow users to ban certain people so we figured it would be best to authenticate before they have a chance to try to join a room. Any help on this issue?

Photon Unity Networking Dedicated Server

$
0
0
Hi!

I tried to make a dedicated server with UNET, but it didnt workout (nat punchtrough fail blabla).
Now, i want to try it with Photon, but i cant seem to find any tutorial of running a Dedicated server? Which is hosted by myself and allows more then 100 CCU's.

I hope that someone can help me out with this!

Thanks!!

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

Photon public connection error

$
0
0
Hello!

I am using the Photon Control panel (Self Hosted). This works with 127.0.0.1
But i have portforwarded my public ip and the port 5055 on TCP and UDP.

i have it setup like this:



But everytime i try to connect it gives me :

Receive issue. State: Connected. Server: '********' Exception: System.Net.Sockets.SocketException: The external host closed the connection.


My photon control is also running on my public ip...

Thanks for any help!!

Custom Authentication Flow

$
0
0
Hi,

I'm a desktop application developer rather than a web developer, so I'm muddling through this. Thanks for your patience :)

My understanding of the authentication flow is something like this:


1. User signs up to my website, with a username and password (let's ignore OAuth2 for now)
2. User fires up my unity application
3. User provides username and password to unity application
4. My website sends them a token that they can use
5. Unity application sends requests to PhotonServer with their username and the token I provided
6. PhotonServer queries my website to see if the token is acceptable
7. My website responds with a properly formatted json result
8. Photon carries on with the request if it was authenticated


1 Can you confirm that I have this much right?
2. I'm looking for suggestions for how to implement my website for this. I've started using ASP.NET Core to build a site and I can log into it from a web page. Does anyone know how to log into it from unity?
3. If ASP.NET Core isn't recommended (I've invested a total of a day in it, so I can change no problems) does anyone have any other suggestions for how to build the web application. I know Python as well as C#.


Thanks for reading this far,

Steve

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

PeerStatusCallbackTimeoutDissconnect

$
0
0
Sorry, I encountered a problem.
In cosole show PeerStatusCallbackTimeoutDissconnect when I try connect to my photon server.
but I already setup my PhotonServer.configuration


UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="PenaltyServerProgram">
UDPListener

Application
Name="PenaltyServerProgram"
BaseDirectory="PenaltyServerDeployment"
Assembly="PenaltyShot"
Type="PenaltyShot.PenaltyServer"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
Application



and I already set public IP、port in my test program. but still failed.
if connect to localhost:5055,it is sucessiful.

please help me if any information misses or any setup misses.

Using fibers with timers

$
0
0
Hi there, I have a noobish question,

I have a timer class that I create an instance of every time I need to do a countdown or have a game timer and I'm having a bit of a struggle trying to wrap my head around how to solve this server side. Would creating a fiber for each instance of these timers, for then to use ScheduleOnInterval to update the timers be wasteful? Would scheduling them on the main game fiber be better, or is there some other easy way of handling elapsed time?

Permissions in custom authentication

$
0
0
Hi,

I'm making progress on custom authentication, but before I go running off down an an over-complicated track I wanted to see if I was doing something wrong.

In the LoadBalancing server example:
1. Authentication is called on operations by MasterClientPeer and GameClientPeer.
2. When a user logs in, they are authenticated by MasterClientPeer - this calls the authentication server
3. When a user creates a room, the are authenticated by GameClientPeer, which doesn't call the authentication server.

These uses are drive by the OnOperationRequest method.

If I want to allow only permitted users to create rooms (e.g. my control panel client) then I modify GameClientPeer so that when OnOperationRequest is called with OperationCode.CreateGame I do an authentication step that involves querying the authentication server to see if the user is permitted to create rooms, right?

So I could do this by inserting something like
this.HandleAuthenticateOperation(request, sendParameters);
above the call to HandleGameCreation and it would try to authenticate.

There are two problems now:
1. Since the GameClientPeer doesn't actually call the authentication server, I'm also expecting that I have to change the HandleAuthenticateOperation
2. I think I may have to override it completely, since at that point it's a CreateGame request, not an authentication request. And that means that I need to pass some parameters along with the CreateGame request from the client - name and password, or an access token.

So, is this about right? Or is there a "limit room creation to specific user roles" switch somewhere (I'm not hopeful, but it would be nice :smile:)

Thanks,

Steve

Receive only 1 Event per second - when 5 per second where send

$
0
0
Hello everybody,

I just started working with Photon Server + Unity SDK , and tried to build a very simple app with one cubes moving in random Directions. This Position change should be shared over Photon Server. Problem is the other client is moving in slowmotion since he only receives 1 package per second.
Any help highly appriciated.

Thanks in Advance !


Problem Description:

Clients send 5 Position Updates via Photon Server, but receive only 1 per second


Setup:

* Photon Server - Load Balancing Example App - default Config, Log Level: Debug
* 2 Unity clients
* Photon Server, GameServer and Both client running on same machine
* TimeStamp Format: Minute:Second:Millisecond
* Send TimeStamp is stored into serialized Data


Detailed Description:


* Both Clients connect to the GameServer and send a position Update 5 times per second.
* Both Clients check for incoming events 5x times a second
* After Both Clients Joined the room ( TimeStamp ~6:48:700),
* It took ~10s until the Client1 reveives an position Update from Client 2
* It tool ~2s until client2 receives a position update from Client1


Client1: Receives 1 Position update event per 2 seconds ( no events skiped )
Client2: Receives 1 Position update event per 1 second ( no events skiped)

If Client1 is terminated, Client 2 will still receive 1 event per second until
all events are received


Client1, ID: 361 Log: ( Started First )


RaiseEvent: Agent Model Id: 361 Position: (0.1292572,2.802357,0.0517029) Send TimeStamp: 6:44:637
RaiseEvent: Agent Model Id: 361 Position: (0.5534592,2.802357,0.2213837) Send TimeStamp: 6:44:845
RaiseEvent: Agent Model Id: 361 Position: (1.271221,2.802357,0.5084884) Send TimeStamp: 6:45:35
RaiseEvent: Agent Model Id: 361 Position: (2.282542,2.802357,0.9130169) Send TimeStamp: 6:45:233
RaiseEvent: Agent Model Id: 361 Position: (3.709411,2.802357,1.483765) Send TimeStamp: 6:45:449
RaiseEvent: Agent Model Id: 361 Position: (5.332334,2.802357,2.132933) Send TimeStamp: 6:45:648
RaiseEvent: Agent Model Id: 361 Position: (65.29237,2.802357,26.11695) Send TimeStamp: 6:48:646
RaiseEvent: Agent Model Id: 361 Position: (69.15047,2.802357,27.66019) Send TimeStamp: 6:48:854
... Raise Event Continues in same time distance ...

Receive Event List:
OnEvent: Code: 255 ( Someone joined the game) ( ~ 6:48:646)
Receive Event: at Time 6:58:246, with Data: Agent Model Id: 236 Position: (0.09418116,2.802357,0.1044182) Send TimeStamp: 6:48:289
Receive Event: at Time 7:00:053, with Data: Agent Model Id: 236 Position: (0.4146467,2.802357,0.459717) Send TimeStamp: 6:48:494
Receive Event: at Time 7:02:250, with Data: Agent Model Id: 236 Position: (0.9405221,2.802357,1.042753) Send TimeStamp: 6:48:698

Client2 ID: 236 ( Started Second)

Raise Event Log:
RaiseEvent: Agent Model Id: 236 Position: (0.09418116,2.802357,0.1044182) Send TimeStamp: 6:48:289
RaiseEvent: Agent Model Id: 236 Position: (0.4146467,2.802357,0.459717) Send TimeStamp: 6:48:494
RaiseEvent: Agent Model Id: 236 Position: (0.9405221,2.802357,1.042753) Send TimeStamp: 6:48:698
RaiseEvent: Agent Model Id: 236 Position: (1.678163,2.802357,1.860573) Send TimeStamp: 6:48:901
... Raise Event Continues in same time distance ...

Receive Event Log:
OnEvent: Code: 255 ( Someone joined the game) ( ~ 6:48:698 )
Receive Event: at TimeStamp 6:50:290, with Data: Agent Model Id: 361 Position: (2.282542,2.802357,0.9130169) Send TimeStamp: 6:45:233
Receive Event: at TimeStamp 6:51:85, with Data: Agent Model Id: 361 Position: (3.709411,2.802357,1.483765) Send TimeStamp: 6:45:449
Receive Event: at TimeStamp 6:52:486, with Data: Agent Model Id: 361 Position: (5.332334,2.802357,2.132933) Send TimeStamp: 6:45:648


Core Functions:
// Use this for initialization
void Start () {
Application.runInBackground = true;
client = new MyLoadBalancer(ConnectionProtocol.Tcp);
client.OnOpResponseAction += Client_OnOpResponseAction;
client.OnStateChangeAction += Client_OnStateChangeAction;
client.MasterServerAddress = "127.0.0.1:4530"; // TCP
client.AppVersion = "1.0";
client.AutoJoinLobby = false;
client.AppId = "Master";
client.Connect();
}

private void Client_OnStateChangeAction(ClientState obj)
{
Debug.Log("Client STate changed: " + obj.ToString());
switch (obj) {
case ClientState.ConnectedToMaster:
//ExitGames.Client.Photon.Hashtable roomPropsForCreation = new ExitGames.Client.Photon.Hashtable() { { DemoConstants.MapProp, maptype.ToString() }, { DemoConstants.GridSizeProp, gridSize } };
ExitGames.Client.Photon.Hashtable roomPropsForCreation = new ExitGames.Client.Photon.Hashtable();
string[] RoomPropsInLobby = new string [] { "Test1"};
client.OpJoinOrCreateRoom("Demo", new RoomOptions() { CustomRoomProperties = roomPropsForCreation, CustomRoomPropertiesForLobby = RoomPropsInLobby }, null);
break;
case ClientState.Joined:
this.SimIsStarted = true;
break;
}
}

private void Client_OnOpResponseAction(OperationResponse obj)
{
Debug.Log("OnResponseActions: " + obj.DebugMessage);
}


Class MyLoadBalancer:
// Called 5x per second
private void SendNetworkData(float obj)
{
this.loadBalancingPeer.SendOutgoingCommands();
}

public override void OnStatusChanged(StatusCode statusCode)
{
Debug.Log("MyLoadBalancer: Status changed" + statusCode);
base.OnStatusChanged(statusCode);
}

// called 5x per second
private void ReceiveNetworkData(float timestamp) {

while (true) {
if (this.loadBalancingPeer.DispatchIncomingCommands()) {

}
else {
//Debug.Log("Dispatch But nothing there");
break;
}

// You could count dispatch calls to limit them to X, if they take too much time of a single frame
}
}

public void SendUpdatePosition(AgentModel model) {
ExitGames.Client.Photon.Hashtable evContent = new ExitGames.Client.Photon.Hashtable();
evContent[(byte)1] = model.Serialize();
Debug.Log("RaiseEvent: " + model.ToString());
this.loadBalancingPeer.OpRaiseEvent(1, evContent,false, new RaiseEventOptions());
}


public override void OnEvent(EventData photonEvent)
{
Debug.Log("OnEvent: Code: " + photonEvent.Code.ToString());
base.OnEvent(photonEvent); // important to call, to keep state up to date
switch (photonEvent.Code) {
case 1:
ReadEvMove((ExitGames.Client.Photon.Hashtable)photonEvent[ParameterCode.CustomEventContent]);
break;
default:
Debug.Log("Not handled event with code: " + photonEvent.Code.ToString());
break;
}
}

public void ReadEvMove(ExitGames.Client.Photon.Hashtable evContent)
{
if (evContent.ContainsKey((byte)1)) {
byte[] posArray = (byte[])evContent[(byte)1];
var model = AgentModel.Deserialize(posArray);
Debug.Log(string.Format("Receive Event: at Time {0}:{1}:{2}, with Data: {3}",
System.DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond, model.ToString()));
OnAgentUpdate(model);
}
else {
Debug.Log("No Content send ");
}
}

Photon Server demo on WebGL - Connect failed

$
0
0
Hi!

I have this error when I'm trying to connect to Photon using my AppID:
Connect failed. SocketImplementationConfig is null for protocol WebSocketSecure

I downloaded the Unity Client SDK from here: https://www.photonengine.com/en/OnPremise/Download.
I opened the "demo-turnbased-memory" and change the Unity platform to WebGL.
And then, when I try to run the demo, the error showed on console.

Probably I'm missing a small configuration on my project.

Can you please help me with this?

Thanks!

LAN connect correct but WAN not

$
0
0
Hi All
I created a Photon Server in my office room. In LAN work is OK, but WAN is not.
Firework is not setup. and outside Port already opened
It still can't connect~~
any can help me to fixed it.

(Photon Server version: Photon-OnPremise-Server-SDK_v4-0-29-11263)

Can't get SDK TestClient to work

$
0
0
When i run the SDK TestClient i recieve the following message in the prompt:

Starting 5 games with 3 players
[11696] Press Return to End
Connecting to 192.168.1.2:5056
[11696] Started game KURO(11696)1 with 3 clients
Connecting to 192.168.1.2:5056
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...

All that i did was:

Donwload the SDK Photon-OnPremise-Server-SDK_v4-0-29-11263.
Set up the license.
Start the SDK.
Set server IP as local
Start LoadBalancing server.
Run TestClient

About Photon Counter

$
0
0
Hello.
I'd like to confirm the item of the ApplicationBase(for example," {ApplicationName}. MessagesSentCount") in the Photon.SocketServer.Diagnostics.PhotonCounter follower by a performance monitor.
I installed PhotonCounter, but that is'nt output.
How should I do?

PhotonServer load-balancing setup (was Redistributable server SDK available in a 64 bit version?)

$
0
0
I am in the mist of setting up multiple servers to support a larger amount of users than a single server can hold. I am assuming that it is not possible to use the regular server sdk for that, yes? And if not, is it then possible to get my hands on a 64 bit version of the redistributable server sdk?
Viewing all 1557 articles
Browse latest View live