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

Game network architecture question (loadbalancer)?

$
0
0
So I am in the process of studying the details of photon. So far I am familiar with the basic concepts. Now I wonder if I shall start from scratch or if I should use and build upon the LoadBalancer SDK Project.

The game itself will require a Master Server (the world) - where people connect and where most game actions are handled - also this game server will be fully authoritative and control everything server side. While this sounds like a MMO concept it isn't, because the game is static and there are no player interactions or realtime movements involved - just basic Operation/Events depending on your actions (I will also use TCP, because no need for reliable UDP here). Surely there will also be some global interactions between players through a chat or a marketplace later on but this could be handled separately. So the master server itself needs to have access to the game database and will be able to control all player actions on their own.

However there will also be the combat part of the game - so e.g. once you click on a specific entity a battle will start. The battle will be real time and will require some basic/slow actions (TCP should be fine - nothing speedy here). Also you will be able to do these kind of combats with friends in coop or pvp.... ->

So this brings me to the question if it wouldn't make sense to use this Master/Game Server mechanic from the loadbalancer sdk to transfer the client over to a specific "room" only during those battles - where they are engaging against players (using the rooms to meet them up) or alone (empty rooms) to fight against npcs. So the game server would then handle the combat - also fully authoritative (I would send all necessary data for the combat together with the client to the game server).

What I would like to know now is, would this scenario be feasible to build upon the loadbalancing sdk - in basic terms - extend the master server and game server functionality in regard of the events/authoritative behavior - or do you think I should rather start from scratch and manage it completely myself - maybe whole mechanic on a single server - and creating several Independent realms per x amount of players.

Thanks a lot for your input,
Oliver

Photon Server : Update ?

$
0
0
Hello,
do you have any information about how to implement an update function with the photon server ? ( a method called every 20ms for instance ).

Thank you.

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!

Using a free 100ccu license on self hosted closed network without connection to internet.

$
0
0
Hello,

I'm currently working on a project where we are using the self hosted photon server to connect over 20 devices, but less than 100 devices. All on a single closed network with no internet connection. We have downloaded and installed the 100ccu license file, but it still limits us to 20 devices unless we connect to the internet to verify the licence file using the license monitor.

This would be fine if we just needed to use the license monitor once to verify the license file, and be done with it, but it looks like each time we shutdown the server or reboot the service it needs to run the license monitor again.

Is there any option to disable the license monitor from having to keep verifying the license file?

MMO Operator - Spwan items without owner

$
0
0
Hi. I'm trying to make my server create items without the need of an owner.

Currently I have the operation SpawnItem, which creates a new actor in the world, but this operation needs an actor owner. The problem here is that when the owner leaves the server, the items generated by him are also excluded from the world.

Currently this operation is used to create ItemType.Avatar and ItemType.Bot.
I would like to use it, to generate several coizas, example: ItemType.armor. Etc.

This need arose from the action of throwing equipment on the ground. I want the other players to have the opportunity to see this dropped item on the floor, and then pick it up. But this is not possible using the Spaw existing in the currently provided example.

Any idea how I can proceed?

I'm thinking of making my own server create an own Actor, pertaining to these items. In this case the server itself would be the owner. But I do not know if it's the right way.
I need help (^. ~). Thanks in advance!

Plugin: How modify the properties of a room to be created?

$
0
0
In my plugin, I need to change some properties of rooms in his creation.
I'm making the changes I need, but these changes are not visible on the client. Look!
      public override void OnCreateGame(ICreateGameCallInfo info)
{
SerializableGameState gameState = new SerializableGameState();
gameState.IsOpen = false;
gameState.IsVisible = false;
if(PluginHost.SetGameState(gameState))
{
info.Continue();
}
else
{
info.Fail("Fail at set new state on room");
}
}
After the room created on the client, we perform a simple check on the Start () component, just to let me know the value of the variables (PhotonNetwork.room.isOpen). But the variables are not suffering changing from plugin! Why??

Please. Can someone help me?

Pointers on extending LoadBalancing demo?

$
0
0
I'm looking for general documentation/resources in terms of extending the LoadBalancing demo. I was wondering if anyone knows of any good sources to point me towards?

I've also got two specific questions on this stuff for now:

1. The LoadBalancing demo covers pretty much 90% of the functionality we need so I was thinking I'd just reuse it as much as possible and extend it where it doesn't cover our needs.

I tried creating a new project that references the Loadbalancing (and Lite) demo and I started creating a new library on top of these with basically my "custom" classes just inheriting from things like MasterApplicationBase and Game (in Photon.LoadBalancing.GameServer) etc and I edited the PhotonServer.config by adding my "CustomMasterServerApplication" where the LoadBalancing application is currently.

However once I ran the LoadBalancing application from the control panel I got an error saying "CustomMasterServerApplication: Cannot create object"

Is this not the right approach to be taking? And do you know of any resources/documentation that you could point me to for more information on how I could go about achieving this?

Edit: Ignore this part of the question. I just did everything again from scratch and it seems to be working fine now, creating my custom application, creating logs for it and everything. Not sure what I was doing wrong before. Still interested in general pointers on extending LoadBalancing of course!

2) From reading the Loadbalancing code and the documentation I get the impression that you need to have multiple server applications on multiple server instances *already* running to make use of all the loadbalancing cleverness, I.e. all the master server will do is just reroute new game requests to the least "fatigued" server instances which are already running instances of my game server photon application.

Which is very cool in itself of course. However I always thought the power of loadbalancing comes from dynamically starting and killing server instances according to the needs of the global load (mind you I am a complete noob in all this so it's not entirely unlikely I had a completely wrong impression). Like I say having a bunch of server instances already running and being able to redirect to them is already pretty cool (and a good enough solution), but I was wondering whether maybe something like the Azure SDK would come with functionality where you'd be able to programmatically start and stop instances as needed (which would be even cooler!)

Sorry for the long questions!

I've finished my game! Now how do I setup the Photon Server Redistributable?

$
0
0
I'd like my players to host servers, I'm sure you've heard this a 100 times before but... Like minecraft :)
So I made my game with Photon Cloud, how do I get this up and running, I can't seem to find any guide to get it into your game.

Architecture using Photon Server for a .io style game (casual arcade MMO)

$
0
0
Hello Photon Hivemind,

We're dipping our toes into the MMO water and thinking of using Photon for the server side of some .io style games. Thinking Agar.io or Slither.io but with very different mechanics and goals. One concept needs to handle up to say 100 people or so on the same server or more if possible. Another concept involves having the server run a 2D physics engine as well but handling say only 20 players at once.

My initial research seems to indicate that basically the Photon Server product is the correct way to go since we would probably want to do an authoritative server model with some client side prediction. The only product that *seems* to let you write your own server code seems to be Photon Server. Photon Unity Network only seems to handle the case where one of the clients effectively becomes the server and everyone else talks to that person... is that understanding correct?

One downside of Photon seems to be that we'd have to run on AWS or some other service/our own hardware, and I'd rather have all of the backend handled entirely by Photon rather than having to maintain servers ourselves.

Most of the articles for making an MMO on photon point at the Photon server, so I think I'll start there unless there's some feedback here to the contrary.

If anyone has any tips, references or links they could share on choosing the right pieces of Photon. Some experts here could probably save us a bunch of time.

Thanks,
C

How to configure self-hosted server using a public Game server IP?

$
0
0
I've been scouring the forums for answers, but haven't found any. I'm using SDK v.4, and simply trying to get the test client to connect using a public IP. It works fine on the local, but not on public or auto. When it tries to connect the test games I get this error:

OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists).

for all of them. I forwarded port 5055, and set up a static IP. I've also created new rules in Windows 10 firewall to allow connections on this port. Help with the config file setup and/or port testing and/or just a full tutorial would be really helpful.

Version incompatibility between client and server (in preparation for IPv6)

$
0
0
I'm trying to get my app approved by Apple, but am running into much the same problem described here:

http://forum.photonengine.com/discussion/7843/photon-server-and-ipv6

Previously, we'd been using the Photon Realtime Unity 3D SDK v4.0.0.7 (I believe -- it's an older version. Looking at the IPv6 page, it seems as though we need at least v4.1.x.x on the client-side to support IPv6.

On the server side, we'd been using Photon Server v3.4.28, but again it looks as though a newer version is required for IPv6, so I upgraded to v3.4.31.

After updating my code in various places, I tried to connect to my server but got the following error:

4480: 09:40:03.640 - CENetThreadPool::Process - Exception - CENetPeerBase::HandleIncomingCommands() - PeerAppSelection()- Init: Unexpected client lib delimiter, expected: 0x01, got: 0x1e : id = 1 [0] Datagram: 00 01 00 02 00 00 00 2C 26 48 56 8A 01 FF 00 04 00 00 00 14 00 00 00 00 00 00 00 00 04 08 F2 EF 06 00 01 04 00 00 00 35 00 00 00 01 F3 00 01 06 1E 41 01 06 00 44 75 6E 67 65 6F 6E 43 72 61 77 6C 65 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - .......,&HV............................5.........A...DungeonCrawler.................. from: 10.0.1.34:57414 on: 10.0.1.134:5055

So it seems as though maybe the client that supports IPv6 is only compatible with servers running v4.x? If that's the case, it sounds like this could be quite the undertaking to get everything going on the server. I hope I'm misunderstanding something here, but I've never been able to find a client/server compatibility chart on your site so I'm kind of at a loss for which client versions should be able to connect to which server versions.

Is there a realtime Unity client version that supports both IPv6 and will connect to a server running version 3.4.31, or am I in for a larger upgrade to 4.1 on the server?

Randomly generated items?

$
0
0
I'm fairly new to Unity and more so new to Photon, my idea is upon player/map spawning in I'd like for items around the map to randomly generate in. Rarity doesn't matter as I'm using Inventory Pro and it could be set change within the crate.

Are there any good assets out there that do this in sync over the Photon network or will it be a better Idea to make multiple copies of my map but changing where I place my crates?

I know of Mega Scatter but it doesn't seem Photon integrated. Any ideas?

Thanks :)

Host and other about Photon Server

$
0
0
(Sorry for my bad english!)

Hi everybody, i have some question about "Photon server" for my Android Game
I don't understand how it's work after read all the documentation ..

I want to use Photon server for a MMORPG but i don't know how begin with photon server .. :/
I have to Host it on a rent server ? I don't want to use my computer to host it, i want my server "safe" away my connection ^^'
I download the server v4.0.29.11263.exe from photon and after ? .. I'm lost ^^"

It's not about scripts conenction , just how to set up my server ^^


Have a good day !
Quentin

Grid World Region Boundaries and Interest Areas

$
0
0
Quick question: How are the gridworld Region boundaries currently handled? e.g., There's an Interest Area (player) near the edge of the a gridworld region, and an item nearby near the edge of the neighboring region. Will the item be subscribed (even though it's not in the same region) or do you have an invisible zone-line near the edge?

Unity RPS demo not working with LoadBalancing Server

$
0
0
I'm setting a new Photon server for a new game and decided to start fresh new Photon server v4 and run the Unity demo with it to test and I got error when I was running the RockPaperScissors demo. The server didn't return userId after the client connected to server and when I tried to join the room via joinrandomroom this error pop up:
Operation failed: OperationResponse 226: ReturnCode: -2 (Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.). Parameters: {} Server: GameServer
Is there any way to fix this. does LoadBalancing not build to run this demo? Note that I can run the demo with PhotonCloud easily.

Both PUN+ and PhotonServer are latest version.

Server closed unexpectedly

$
0
0
376: 00:04:27.390 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
9032: 01:23:08.504 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
6980: 02:11:46.240 - CFilterDataBase::OnSocketReleased() - References still held: 2
7612: 04:14:27.846 - CTCPOutboundConnectionManager::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
7612: 04:37:41.553 - CTCPOutboundConnectionManager::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
8016: 04:42:06.862 - CFilterDataBase::OnSocketReleased() - References still held: 2
7612: 05:16:10.357 - CTCPOutboundConnectionManager::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
7612: 05:16:10.559 - CTCPOutboundConnectionManager::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host.
5236: 05:16:20.777 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
6424: 05:30:02.852 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
6652: 05:49:19.532 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
3280: 05:49:23.354 - CManagedHost::OnFailure() - FAIL_CriticalResource - eThrowException
3280: 05:49:23.354 - CManagedHost::OnFailure() - FAIL_CriticalResource - eThrowException
7712: 06:04:32.336 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
7712: 06:04:32.383 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
8444: 06:11:06.237 - CFilterDataBase::OnSocketReleased() - References still held: 2
1508: 06:13:56.839 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
1508: 06:13:56.854 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
1508: 06:13:56.901 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
4644: 06:22:01.438 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
7412: 06:26:42.472 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
6164: 06:26:58.774 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
8196: 06:27:18.696 - CFilterDataBase::OnSocketReleased() - References still held: 2
3260: 06:33:51.926 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
3260: 06:33:51.972 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
4168: 06:45:22.164 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
5744: 06:50:13.682 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
3944: 06:54:36.121 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
7888: 07:01:00.990 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
3612: 07:01:00.990 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
7924: 07:01:08.571 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
3576: 07:05:49.247 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
6404: 07:05:49.247 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
2356: 07:32:28.343 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

7152: 07:32:28.546 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

1784: 07:32:28.733 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
6776: 07:32:28.921 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

4464: 07:32:28.936 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

5428: 07:32:28.952 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

1236: 07:32:29.139 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.

8420: 07:49:20.380 - CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An established connection was aborted by the software in your host machine.
7140: 07:49:29.178 - CManagedHost::OnDefaultAction() - OPR_ThreadAbort - eAbortThread
8996: 07:55:29.741 - CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host.



plz,help me!!!!!!!

Moved: Custom Operations

PUN and Photon Server compatible?

$
0
0
Hello,

when deciding on which client API SDK I will build upon in conjunction with the photon server SDK Load Balancer module (in order to support 100% authoritative control) within a unity game - I can see there are 2 basic options. One is the standard Photon Unity 3D SDK (LoadBalancer API) as well as the PUN from the asset store.

However this is not clear to me - does this mean that you could also use PUN to connect to your own server instead of the cloud (as seen in configuration)? If so, how does the licensing work (do you have to license both then for the amount of CCUs?) - and are all features available in the custom server to support PUN?

If yes, my basic question would be - is it smart to use PUN together with Photon Server SDK and extend it or should you better build upon the given Photon Unity3D Client SDK Load Balancer API to handle your custom logic?

Thanks for your time,
Oliver

Photon server Error on large packet

$
0
0
I send back data from my server which include data of 100 objects that size around 38000 byte and it show on the log that error on create response message can it be fix ? or any solution to send object around 300-400 back to client ?
Thx

Need help for player management with PUN.

$
0
0
Hi everyone,

Now I'm finished a multiplayer game created with PUN and Unity. Now I would like to publish my game and would like to save and manage player's data. So, how I continue to do? Should I use photon server? I'm now losing way.

Please guide to me a good point to solve it.
Thank you all

PS. Sorry for my bad English.
Viewing all 1557 articles
Browse latest View live