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

ReliableHTTPListener

$
0
0
ReliableHTTPListener what is, how to use, have relevant documents

Get Connection State of the ITEM in MMO

$
0
0
Hello, I'm working with the current Unity3DGrid example of the MMO application.

I've noticed that if the player disconnects from the server and is not in the area of interest of other players, they have no way of knowing that the disconnected player is really disconnected.

None Disconnect event is triggered for other players unless they are in the area of interest. This is relatively good. The problem is in the UPDATE process of items referring to players who are no longer connected. In my Unity Editor I can see that the player's Prefab object continues in the scene even though it is no longer connected. In the Script of the player it only knows that it is not active for updates and thus it disables the rendering of the mesh, but the object still exists and its UPDATE continues to consume process.

I'm trying to implement some verifier so I can check if a certain player is actually connected, otherwise I will effect the destruction of his components on the scene.

Currently in my script of players in Unity I have how to know if the player should be processed, from the following script:
if (this.item.IsUpToDate == false)
{

ShowActor(false); //Desactive mesh render
return;
}
Maybe it would be interesting if I had so mething like this to know that this object is no longer connected:
if(this.item.isConnected==false)
{
DestroyMe();
return;
}
And even if the OnDisconnected event or OneWorld Exit triggered for all online players regardless of interestArea .

I'm working with the Photon.MmoDemo.Client.Unity3D source , but I'm not having success.

Issues With Photon and WebGL Unity

$
0
0
Hi,
I'm new here so sorry if this is the wrong place for this.

I have a built a costume photon server to run an MMO style game. The game is built in Unity. The server and project work fine when you play it in the unity editor, but when we compile it to WebGL and attempt to run it we get this error:


blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:1 Uncaught Assertion failed: 0 && "The target platform does not support Sockets", at: C:\Program Files\Unity 5.4.0b20\Editor\Data\il2cpp\libil2cpp\os\Generic\SocketImpl.cpp,50,SocketImpl at Error
at jsStackTrace (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:1:22874)
at stackTrace (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:1:23057)
at ___assert_fail (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:1:261781)
at YKn (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:22:577281)
at JIn (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:22:552497)
at XAn (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:22:417981)
at wuh (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:14:1038026)
at XAh (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:11:33162)
at Array.WAh (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:11:32946)
at Array._kk (blob:http%3A//localhost/6f801906-3dfb-4efd-a47b-7f09948339c8:9:818273)

What does this mean? Can it be fixed?
I am fairly advanced with programming and networking so please feel free to be technical.
Thanks for any help.

Where are my log entries?

$
0
0
Hi, I used this in my WebHooksPlugin.cs file to stoer some info in the logs:

this.PluginHost.LogDebug("Message");

However, I can't find my entries in any of the log files.

Where are them?

How to debug server code

$
0
0
Couple of methods I came up with for debugging server code. Hope it will help someone to save up some time. :-) Btw I'm using Visual Studio 2008.

First, be sure to setup your Visual Studio project to update server's files automatically. There are two ways to achieve this: 1) go to your server project properties, and in Build tab select Output path to point to the path were Photon is loading your dlls (for example: "e:\Projects\Photon\Server\deploy\Mmo\Photon.MmoDemo.Server\bin\"). 2) Another way to do this is to go to Build Events and add a post build event to copy the files there. Something like: "copy "$(TargetDir)" "$(SolutionDir)\..\..\deploy\Mmo\Photon.MmoDemo.Server\bin\"", also don't forget to choose Run the post-build event: When the build updates the project output. Setup Photon to automatically load changed dlls, and after you hit F5 or Ctrl+Shift+B in Visual Studio, the files will end up were they should be, and Photon will restart the server with your new code.

Now for the debugging part, there are 3 methods. But before debugging make sure Photon is using 2.0 version of .Net runtime! To do this edit your PhotonSocketServer.config file and for instance config add this:
<Runtime
	Assembly="PhotonHostRuntime, Version=2.0.0.0, Culture=neutral"
	Type="PhotonHostRuntime.PhotonDomainManager"
	CLRVersion="v2.0">
</Runtime>

1. Attaching debugger.

Go to Debug -> Attach to Process, select PhotonSocketServer.exe. Also for Attach to: select only Managed code. If you select Native code, then detaching debugger will kill server process. After that hit Attach, and there you go.

2. Launching debugger from your code.

In your Application class (the one that inherits Photon.SocketServer.Application) override Setup() method and add this line: System.Diagnostics.Debugger.Launch(); . When your server code will be launched you get a nice message box that will ask you if you want to attach the debugger. You can debug startup code this way!

3. Attaching debugger automatically.

This one is my favorite, as it attaches the debugger by simply clicking F5 in Visual Studio. For this create a dummy empty C++ project in your solution. Add main.cpp and a stub for main(). Select it as startup project. Setup project dependencies that building this one will build your server too. Go to project properties and in Debugging tab change Command to where PhotonSocketServer.exe is located, for example: "e:\Projects\Photon\Server\deploy\bin_Win32\PhotonSocketServer.exe". For Attach choose Yes. Set Debugger Type to Managed Only (mixing with native kills the server after detaching debugger). And voila! Hit F5 and it will compile, update your server, and attach a debugger in just a couple seconds. :-) And you can debug startup code this way too!

Does WebSockets not send InitObject in the InitRequest?

$
0
0
I have an implementation where everything works smoothly with regular Sockets, but as soon as I start using WebSockets for the connection the InitObject of InitRequest is always null. I know it's not a serialization issue because if I bypass that step, the client and server communicate perfectly fine through the WebSockets connection. It's just the InitObject in the InitRequest is always null when WebSockets is used.

Is this the expected result? Should I just work around this and not use initObject for authorizing connections?

Moved: Get Connection State of the ITEM in MMO

Moved: Issues With Photon and WebGL Unity


Tutorial on how to use Photon self hosted using Amazon EC2

$
0
0
Hello,

I started using Photon self hosted server on my home computer and it works, now I want to set it up for real on a real server so that i can launch the Unity game to the public.

Is there any tutorial out there that shows how to set up Photon self hosted server on Amazon EC2 server for WebGL type games that uses WebSocket and wss (ssl)?

Thanks

IncomingGameServerPeer[(null)] - OnDisconnect: game server connection closed

$
0
0
Hello,

I have setup Photon on my AWS server and it's working fine there.

But i'm facing problems in connecting my game client with the Photon Server setup on AWS.

It's throwing the same error again n again (IncomingGameServerPeer) in the photon logs.

Can someone help me out with this ?

What is Photon Server

$
0
0
My question is somewhat broad so let me try to explain. Basically, I have a custom server running and hosted by an external company(not photon). I however, am trying to find the best option to network my Real-time Racing game. I stumbled upon Photon Server, however the payment system of it confuses me. From what I read, Photon Server does not actually provide it's server, I thought of it as a system that allowed me to upload the exe and run that(the exe) off of a server already made(my external server). Do I have all of this confused? The reason the payment system is weird is, if it does not provide the servers then why would I want to pay for p/CC when I'm hosting the server myself and just looking for an API?

With that being said, assuming that some of it is wrong, what would be the best option to have networking in my game along with server side logic and authentication? Does photon provide something such as this? I'm trying to find a system with a one time payment of a premade API and can just use that on the server I am hosting and all of Photons plans seem to be a per CC payment.

I'm very new to all of this stuff so I wouldn't be surprised if most of the stuff I said was off or the terminology was weird, but I'm looking for guidance to the best option for me. Because of that, any help at all would be amazing. Thanks!

Photon Server Unity Tutorials

$
0
0
Hello,
I am developing a fast-paced 3rd person shooter game. Its multiplayer (ofcourse). The first prototype of the game was developed using Unity Networking(LAN). After receiving positive feedback and several requests to make it online multiplayer, I decided to move the game to Photon Cloud. However, there were several issues with using Photon Cloud. There were tons of complaints about slow and laggy servers. I was wondering why? If player with slow connection is hosting the game, others player will have latency issues (even though they have high speed connections).

Only way to fix this issue is to use Photon Server. I have been digging since 2 weeks for tutorials on how to write server-side code. No Luck! All i find is "how to setup photon server in 5 mins" videos. Is there any tutorial series that includes setting up server, custom login, matchmaking, player position syncing, custom kill/death logic, gameover, etc? I'm soo frustrated searching for tuts. Hence, posting in the forum...xD. I found MMO Demo in the SDK. But its complex. I couldnt find any documentation on how the demo works. Going through the code and figuring it out yourself is next to impossible for beginners like me. Moreover, the link to Unity client project for MMO Demo is dead. So, i don't know how to test it either.

AAA games like overwatch, DOTA2, etc simulate the game on their servers. Player interactions are sent from the local client to server. Server validates them and executes them on the server. Then server sends results back to client. Is this possible to achieve with Photon server?

Any kind of help is highly appreciated!!
Thank you.

ChatServer tutorial

$
0
0
Hello, i trying to make ChatServer tutorial to understand how to build server apps
But when i try to start ChatServer app it not start and in logs i see this:

12280: 21:29:53.435 - ChatServer:2 - Start() failed.
Exception:
System.TypeLoadException: Failed to create object "ChatServer" from assembly "ChatServer".
at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.Start(String assemblyName, String typeName, String instanceName, String applicationName, IPhotonApplicationSink sink, ILogToUnmanagedLog logger, IControlListeners listenerControl)
at PhotonHostRuntime.PhotonDomainManager.Start(String assemblyName, String typeName, String instanceName, String applicationName, IPhotonApplicationSink sink, ILogToUnmanagedLog logger, IControlListeners listenerControl)
12280: 21:29:53.436 - ChatServer:2 - Stop() failed.
Exception:
System.Exception: Stop: unable to call the Application.TearDown() - undefined photonControl.
at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.Stop()
at PhotonHostRuntime.PhotonDomainManager.Stop()
12280: 21:29:53.436 - ERROR: Failed to start application: "ChatServer" in app domain: 2
9972: 21:29:53.436 - CManagedHost::OnDefaultAction() - OPR_AppDomainUnload - eUnloadAppDomain
12280: 21:29:53.436 - CService::OnException() - Exception: CManagedHost::StartApplication() - Failed to start application in AppDomain: 2 - Failed to create object "ChatServer" from assembly "ChatServer".
12280: 21:29:53.436 - Server shutting down...

Could you give me a hint. Thank you!

Redist License

$
0
0
Hello, I'm trying to get a Redistrubutable server up and running to support LAN for my game. However im getting:
ERROR: Wrong License type - expected redist license. Going to Shutdown.

Where can I get / upgrade my license?

Thank you very much

Error: Photon.Loadbalancing.dll.config does not exist

$
0
0
But it does...



And now I'm having problems removing the LoadBalancing service (I was trying to remove it and re-install it).

How to I set content type in CustomAuthentication.

$
0
0
I'm using setAuthPostData to generate an http post. The remote endpoint is successfully contacted but the call fails because the endpoint is expecting the Content-Type header to be set to application/Json. I see no documentation or support for being able to set header values for this call. Any assistance would be appreciated.

How can I send messages to Photon Server using PUN?

$
0
0
I want to send my action to the server, and have the server handle validation, acknowledgment (that the action is valid), and broadcasting it to the clients. How do I do that using PUN?

A follow-up question is, how do I broadcast messages to the clients from the server?

How to get PingVelue in photonServer Code?

$
0
0
first sorry for my poor english !
How to get PingVelue in photonServer Code?
I can Get it in PUN.but how to get it in photonServer?
please thx

How to derive from GameApplication?

$
0
0
I added Photon.LoadBalancing.GameServer namespace but Visual Studio says that LoadBalancing namespace does not exist. I also added LoadBalancingApi.dll in my References.

What am I missing? This is a screenshot of my simple project.

Where is Photon.LoadBalancing.dll?

$
0
0
In the API documentation of Photon Server, there is a namespace called Photon.LoadBalancing. However, the assembly is not included in the Photon Server SDK. I can see Photon.SocketServer.dll in libs folder, but there is no Photon.LoadBalancing.dll.

Am I missing something? I want my classes to derive from GameApplication and GameClientPeer.
Viewing all 1557 articles
Browse latest View live