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

Problems with photon

$
0
0
Hi every one, i have a problem with the photon and a starting use this last night. There is two problems one is "PhotonNetwork.connected = false" and the other is "Timeout Disconnect while connecting to: ns.exitgames.com.5058.Check if the sever is available" i tryied change the region but doesn't worked. Please help me

HttpApplicationHandler

$
0
0
How to use HttpApplicationHandler for web Server to connect Photo Server ?
I don't found many information about it.
Please

Client Disconnect after watching video ad or in-app purchase

$
0
0
Hi.
I extended photon server Load Balancing app and hosted it in my local computer . I also connect my client to this server by using unity3d client plugin not PUN . Everything is fine but when client watch video or try in-app purchase , It disconnected from server . This happen when watching video end or in app purchase completed and after that , When returning to unity it disconnected from server . After debugging I noticed this is server who initiate disconnecting because client first get DisconnectedByServer Message and then Disconnected from server.
I even used PhotonNetwrok.BackgroundTimeout = 600; but it didn't help.
Please help me to solve this problem .
Thanks

Web Server

$
0
0
I want to make web server for payment, admin tools, ... by php
How to connect photon server ? What solution ?

setup new server with vps server

$
0
0
so im planning to buy vps server after 2 days so can i setup my server by :
download the server sdk there and then open photon control and start load blancing then put the ip address on my unity photon self host ip address right ? that how is work ?

Sending Post Data in authentication requests

$
0
0
Hi,

I've got my authentication server set up, but it really likes to deal with POST requests. I've figured out a hack to get around it, but it would be great if I could send post requests.

I understand that if I want to send posts I just need to use
AuthValues.SetAuthPostData(...);
Unfortunately, I have no idea what that will do in terms of formatting.

First, I need to set the format of the post request to x-www-form-urlencoded
Then I need to add some key value pairs.

Any suggestions about how to do this? I have no idea what this text should look like and couldn't find any documentation.

Thanks,

Steve

Where can I find an example Unity project using Photon Server?

$
0
0
I have just downloaded and installed the Photon SDK on my server and would like to try connecting to it from a Unity project on a different machine & network. Is there a sample project available for this?

Looking for advice before starting a project with this

$
0
0
First the goal of the project:
We want to have a server that does everything. Most of the examples I see about photon are having the clients direct gameplay. However we are trying to create a server side solution for our turn based battle game where clients have no control over what happens and simply submit orders and get told what happens because of those choices they make. Is Photon appropriate for this style of game with tons of heavy game logic in the photon code?

2nd question is, our client is unity and the download page says this:
Below SDK implements a lean networking framework, LoadBalancing API, offering programmers detailed control. As alternative, use Photon Unity Networking (PUN) which integrates more tightly with Unity's development approach.

It doesn't really explain the pros and the cons of using this SDK vs using PUN. If I have no prior experience concerns and just want to use the best option which should I be using?

Finally, after what I read it sounds like I should base the game off of the LoadBalancing application. However there does not appear to be a client sample app that is the client half of the LoadBalancing demo app. Does this exist?

Thanks for any input!

Moved: reconnectAndRejoin() In UE4 sdk not work.

Load balancing concept

$
0
0
Hi. I'm new in Photon, and I want to understand few basics ideas of it.

let's say, I have one VPS. And I try to start Load Balancing instance by Photon Control.
In documentaion says "Loadbalanced setup for local development: A Master-server and two game-servers."
and config

<Applications Default="Master">
<Application
Name="Master"
BaseDirectory="LoadBalancing"
Assembly="Photon.LoadBalancing"
Type="Photon.LoadBalancing.MasterServer.MasterApplication"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config"
ApplicationRootDirectory="LoadBalancing"
>
</Application>

<Application
Name="Game"
BaseDirectory="LoadBalancing"
Assembly="Photon.LoadBalancing"
Type="Photon.LoadBalancing.GameServer.GameApplication"
ForceAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config"
ApplicationRootDirectory="LoadBalancing"
SharedDirectory="Plugins">
</Application>

</Applications>
And first question is: where is second game server? Or game-server instances are dynamically genetated?

Ok, next I'm thinking about servers and balancing.
How exacly servers are takes a hardware resource? One instance - one CPU? Thread? Why I need to use load balancing rather than Hive?
For example, I need to create 100 rooms with 50 users each in my real-time (fps) game. Maybe Hive-type will be enough.. I think not. But why?

One more question is: can I run Master and Game servers on different VPS? Is it possible?




Bot with real actorNumber

$
0
0
Is there any way to create a bot player but have a real actor number registered with photon so the clients will see the bot the same as a real player?

Why am I getting a client-side Connection TimeOut error?

$
0
0
I have Photon Server installed on a remote PC. I have the LoadBalancing game running as a service and I have set Game Config IP to "Set Public: ".

On another PC (on another network), I try to connect to the server using PUN+ and these settings:



I am using PhotonNetwork.ConnectUsingSettings("1") to try to connect to the server.
After a few seconds, I get a time out error on the client side.

Here are some recent server-side logs:
2016-12-10 00:04:44,679 [17] INFO  Photon.LoadBalancing.GameServer.GameApplication - Setup: serverId=21a4a33c-21a5-4d97-8f9d-2198479fb4a0
2016-12-10 00:04:45,104 [17] INFO Photon.Common.LoadBalancer.Common.PublicIPAddressReader - Public IP lookup - remote endpoint: 104.45.24.151 (InterNetwork), local endpoint: 0.0.0.0 (InterNetwork)
2016-12-10 00:04:48,171 [17] INFO Photon.Common.LoadBalancer.Common.PublicIPAddressReader - Public IP address: myPublicIp, lookup at http://licensesp.exitgames.com/echoip
2016-12-10 00:04:49,340 [17] INFO Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - HTTP Queue performance counters successfully initialized
2016-12-10 00:04:49,348 [17] INFO Photon.SocketServer.Diagnostics.HttpQueuePerformanceCounters - Internal HTTP Queue performance counters successfully created
2016-12-10 00:04:49,362 [17] INFO Photon.LoadBalancing.GameServer.GameApplication - TokenCreator intialized with an expiration of 02:46:40
2016-12-10 00:04:49,380 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter Business Logic Queue
2016-12-10 00:04:49,388 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter ENet Queue
2016-12-10 00:04:49,396 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter bytes in/sec
2016-12-10 00:04:49,402 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter bytes out/sec
2016-12-10 00:04:49,408 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter ENet Threads Processing
2016-12-10 00:04:49,414 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter ENet Threads Active
2016-12-10 00:04:49,420 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter Time Spent In Server: In (ms)
2016-12-10 00:04:49,426 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter Time Spent In Server: Out (ms)
2016-12-10 00:04:49,433 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter TCP: Disconnected Peers +/sec
2016-12-10 00:04:49,439 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter TCP: Disconnected Peers (C) +/sec
2016-12-10 00:04:49,444 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter TCP: Peers
2016-12-10 00:04:49,452 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter UDP: Disconnected Peers +/sec
2016-12-10 00:04:49,458 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter UDP: Disconnected Peers (C) +/sec
2016-12-10 00:04:49,464 [17] WARN Photon.Common.LoadBalancer.LoadShedding.WorkloadController - Did not find counter UDP: Peers
2016-12-10 00:04:49,480 [17] WARN Photon.Common.LoadBalancer.LoadShedding.FeedbackControlSystem - Could not initialize Feedback Control System from configuration: Invalid configuration file C:\Users\Rafael\Downloads\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config. Using default settings... (Could not find file 'C:\Users\Rafael\Downloads\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Workload.config'.)
2016-12-10 00:04:49,495 [17] INFO Photon.Common.LoadBalancer.ServerStateManager - Watching for application state file in C:\Users\Rafael\Downloads\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\ServerState.txt
2016-12-10 00:04:49,504 [17] INFO Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
2016-12-10 00:04:49,510 [17] INFO Photon.LoadBalancing.GameServer.GameApplication - Initializing master server connection ...
2016-12-10 00:04:49,609 [17] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Connecting to master at 127.0.0.1:4520, serverId=21a4a33c-21a5-4d97-8f9d-2198479fb4a0
2016-12-10 00:04:49,635 [17] INFO Photon.SocketServer.ApplicationBase - Application start: AppId=Game; AppPath=C:\Users\Rafael\Downloads\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\LoadBalancing\GameServer, Type=Photon.LoadBalancing.GameServer.GameApplication
2016-12-10 00:04:49,648 [17] INFO Photon.SocketServer.Diagnostics.CounterPublisher - CounterPublisher started publishing ExitGames.Diagnostics.Monitoring.CounterSamplePublisher to ExitGames.Diagnostics.Monitoring.CounterSampleSender
2016-12-10 00:04:49,662 [17] INFO Photon.LoadBalancing.GameServer.GameApplication - OnStopRequested: serverid=c6356ec2-6e00-45ba-a0bf-602d9812027c
2016-12-10 00:04:49,670 [17] INFO Photon.SocketServer.ApplicationBase - Application is stopping: AppId=Game
2016-12-10 00:04:49,674 [18] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - connection to master closed (id=3, reason=ManagedDisconnect, detail=), serverId=c6356ec2-6e00-45ba-a0bf-602d9812027c
2016-12-10 00:04:49,683 [17] INFO Photon.LoadBalancing.GameServer.GameApplication - TearDown: serverId=c6356ec2-6e00-45ba-a0bf-602d9812027c
2016-12-10 00:04:49,690 [17] INFO Photon.SocketServer.ApplicationBase - Application stop: AppId=Game
2016-12-10 00:04:49,707 [12] INFO Photon.LoadBalancing.GameServer.MasterServerConnectionBase - Master connection established: address:127.0.0.1
2016-12-10 00:04:49,714 [12] INFO Photon.Common.LoadBalancer.ServerStateManager - Server state is set to online
2016-12-10 00:04:49,724 [12] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Registering game server with address myPublicIp, TCP 4531, UDP 5056, WebSocket 9091, Secure WebSocket 19091, HTTP 80, ServerID 21a4a33c-21a5-4d97-8f9d-2198479fb4a0, Hostname localhost, IPv6Address
2016-12-10 00:04:49,757 [21] INFO Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer - Successfully registered at master server: serverId=21a4a33c-21a5-4d97-8f9d-2198479fb4a0
2016-12-10 00:08:03,656 [24] INFO Photon.Common.LoadBalancer.LoadShedding.FeedbackController - Transit CpuUsage from Lowest to Low with input 35
2016-12-10 00:08:03,663 [24] INFO Photon.Common.LoadBalancer.LoadShedding.WorkloadController - FeedbackLevel changed: old=Lowest, new=Low
2016-12-10 00:35:10,562 [11] INFO Photon.Common.LoadBalancer.LoadShedding.FeedbackController - Transit CpuUsage from Low to Lowest with input 20
2016-12-10 00:35:10,720 [11] INFO Photon.Common.LoadBalancer.LoadShedding.WorkloadController - FeedbackLevel changed: old=Low, new=Lowest
2016-12-10 00:38:46,988 [23] INFO Photon.Common.LoadBalancer.LoadShedding.FeedbackController - Transit CpuUsage from Lowest to Low with input 35
2016-12-10 00:38:46,996 [23] INFO Photon.Common.LoadBalancer.LoadShedding.WorkloadController - FeedbackLevel changed: old=Lowest, new=Low
If any other info is required, please let me know.

Thank you.

JS CreateRoom plugins

$
0
0
I'm trying to create new room by js sdk 4.0.0.5

In docuentation says I can set plugin name in room options by
roomOptions.Plugins = new string[]

But I don't see it in photon-javascript_SDK.js-file
LoadBalancingClient.prototype.createRoom = function (roomName, options)

I'm trying to put
createRoom("name", {plugins: "MyPlugin"})
or
createRoom("name", {customGameProperties: {plugins: "MyPlugin"}})
but it's not work

My factory is

public IGamePlugin Create(IPluginHost gameHost, string pluginName, Dictionary<string, string> config, out string errorMsg)
{
gameHost.LogWarning("!!!: > " + pluginName + " <<");

IGamePlugin plugin;
switch (pluginName)
{
case "MyPlugin":
plugin = new MyPlugin();
break;
default:
plugin = new PluginBase(); // default
break;
}
return plugin.SetupInstance(gameHost, config, out errorMsg) ? plugin : null;
}
always empty in pluginName. Am I doing something wrong?

Moved: JS CreateRoom plugins

Problem connecting to self hosted photon server

$
0
0
Hi.
I have a big problem connecting to my self hosted photon server . Photon server hosted in a VPS windows server 2008 r2 . When I try to connect to my server from unity , I get this error :

TimeoutDisconnect while connecting to: "MyServerPublicIpAddress". Check if the server is available.

(PhotonNetwork.connectionStateDetailed value is 'ConnectingToMasterServer' until i get above error)

What I have done so far :

In Server :
- Photon server v3 is running in my server . Loadbalancing(MyCloud) is running , also RunTestClient works properly.
- GameServerIP set to my PublicIPAaddress.
- Firewall is off
-There is not physical router available for me because my server is running on VPS.( I Also call technical team which I bought my VPS from them but they answer me that you should use some software to configure port forwarding and there is no router available for you , So I don't know if I still need configure port forwarding or not ).
- I used command "netstat -an" and the result was something like this :
Proto               Local Address                              Foreign Address                        State
...
UDP                MyPublicIPAddress:5055               *.*
UDP                MyPublicIPAddress:5056               *.*
UDP                MyPublicIPAddress:5057               *.*
...



In Client :
-Firewall is off
-PhotonNetwrokSetting in unity is set to self hosted and IP is set to my server Public IP and port is set to 5055.

I actually test self hosting in my local network and clients in the same network can connect to server without any problem.

Please help me because I really don't know what else should I do?

Thanks for your answers.

Custom authentication ContentType

$
0
0
Hi,

Last question (I hope). I've written a tutorial that I'm going to post soon. I'm just ironing out details.

I have a working system, but I wanted to check something before I put up something that's actively wrong.

I'm using POST data for the username and password, and I'd like to be able to just use the model binding in ASP.NET Core. Unfortunately, I think that needs the contentType field to be set in the POST message. When I send a POST from Photon, I get a null content type. This means I have to open the body as a stream and read it in. It's not impossible, just inelegant, and a bit hard to explain :smile:

So is there a way to set the content type to something? Or does someone know of a way I can use model binding without it?

Thanks,
Steve

How to use Photon 4 Plugins?

$
0
0
I use Photon 4 Plugins to extend the Game/Room behavior.

Here is how i use it:
1. I save the room data in Plugin, i think one plugin one room, is that right?
2. I override OnRaiseEvent() to deal all custom logic, and use data that was saved in the plugin.

Do i need to consider multi-threaded or Asynchronous task problem?


public override void OnRaiseEvent(Photon.Hive.Plugin.IRaiseEventCallInfo info)
{
if (info.Request.EvCode == ClientReuestTask)
{

//Do many task.
//What will happen if i sleep here? Other room logic will stop?
info.Cancel();
}
else
{
base.OnRaiseEvent(info);
}
}

How to use Photon Plugins?

$
0
0
I use Photon 4 Plugins to extend the Game/Room behavior.

Here is how i use it:
1. I save the room data in Plugin, i think one plugin one room, is that right?
2. I override OnRaiseEvent() to deal all custom logic, and use data that was saved in the plugin.

Do i need to consider multi-threaded or Asynchronous task problem?

public override void OnRaiseEvent(Photon.Hive.Plugin.IRaiseEventCallInfo info)
{
if (info.Request.EvCode == ClientReuestTask)
{

//Do many task.
//What will happen if i sleep here? Other room logic will stop?
info.Cancel();
}
else
{
base.OnRaiseEvent(info);
}
}

Multiroom chat

$
0
0
Hi, all!
I have a simple question.
How to create multiroom chat on Photon Server (not on photon cloud)?

I found on client:
- keepMasterConnection - fot staing in master lobby always
- masterPeer.sendOperation - for sending to master
on server almost nothing.. maybe AppLobbyType.ChannelLobby

I also found Photon.Chat.ChatClient with subscriptions and so on, but it's not work with Photon Server (maybe only with cloud)

Someone?

photon with slacklogger?

$
0
0
I am trying to setup custom log4net appenders on photon but the dll does not seem to be reading any of the configs.

The docs also say photon already has log4net but I see no evidence of this.
Viewing all 1557 articles
Browse latest View live