Our client asked us if we could make their application work in a place with poor or no internet connection.
We continued developing in the cloud and when we were happy with the game we started testing it on our self hosted server.
We quickly noticed that some configurations / settings of the LoadBalancing solution are a bit different then working in the cloud.
1) We had to authenticate our user by setting PhotonNetwork.AuthValues (otherwise we could not connect)
2) We noticed that some events were not being passed on to the player that was setting them. I.e. When we were settings player / room properties in the cloud everything was being passed on to ALL the players, including the player that was sending out these events.
3) We also noticed that room properties (& player properties) were often erased after level load. We are not sure if this was or was not happening in the cloud. I assume room properties should keep existing when the level reloads? In our project immediately when the new level was loaded the masterclient had correct roomproperties, the second client did not. We temporary hacked it by resending the roomproperties from the master client. A few seconds later the master client received empty room properties (don't know where they came from). Could someone explain me what is happening here?
We were wondering if it is possible to get a LoadBalancing setup that immitates the Cloud properly. This would allow us to develop our application in the cloud and afterwards move to a self hosted solution seamlessly. Is there such LoadBalancing setup / config available?
Are there any other differences between the cloud and the loadbalancing setup?
↧
Loadbalancing different from Cloud Server
↧
Moved: Automatically Reconnecting on Leaving Room
This discussion has been moved.
↧
↧
Failed to instantiate object in OnJoinedRoom callback
Hi,
I am using PUN(v1.9) and local Photon server(4.0.29.11263).
I want to instantiate a network object by PhotonNetwork.Instantiate in OnJoinedRoom() like:
public override void OnJoinedRoom()
{
PhotonNetwork.Instantiate(myPrefabName, ...);
}
However sometimes the object is not instantiated in other clients. The issue usually happened on the user who joined later, for example: 7 users already in the room and the issue happened on the 8th user.
I found some logs near the timing of issue happened.
PUN:
Operation 253 could not be executed (yet). Wait for state JoinedLobby or ConnectedToMaster and their callbacks before calling operations. WebRPCs need a server-side configuration. Enum OperationCode helps identify the operation.
Server:
2018-11-28 10:48:37,531 [37] DEBUG Photon.SocketServer.PeerBase - SentOpResponse: Peer=GameClientPeer: PID 3660, IsConnected: True, IsDisposed: False, Last Activity: Operation 253 at UTC 11/28/2018 2:48:37 AM in Room M63H, IP 10.116.132.147:62574, , opCode=253, return=-3(Operation is not allowed on this join stage), ChannelId=0 result=Ok size=53 bytes
Does that mean even if client has got OnJoinedRoom callback but the server is not ready to raise event?
Thank you.
↧
Photon Bolt on dedicated server make no session
Hello. I am using Bolt's matchmaking for my multiplayer project in Unity 2018.2.5 . I’m using photon dedicated server instead of photon cloud, but I am having an issue with retrieving sessions created with Bolt Engine.
Here is the server-side code, where I create a session and then load a room:
BoltNetwork.SetServerInfo ("MyPhotonGame", null);
BoltNetwork.LoadScene("main");
And here is the client-side code, where I retrieve the sessions and join the first one
public override void SessionListUpdated(Map sessionList)
{
Debug.LogFormat("Session list updated: {0} total sessions", sessionList.Count);
foreach (var session in sessionList)
{
UdpSession photonSession = session.Value as UdpSession;
if (photonSession.Source == UdpSessionSource.Photon)
{
BoltNetwork.Connect(photonSession);
}
}
}
The problem is that BoltNetwork.SessionList is always empty
When I’m using photon cloud everything working fine, the problem is when I connect to my dedicated server running on my local network.
The Host Player(first one) is connected to Loadbalancing application and playing fine, but the clients cant find any session to connect to.
In PerfMon counters shows Host and Clients connected to Photon Socket Server UDP.
Is there something I am missing or doing wrong ?
Thank you very much.
↧
Disconnect and reconnect in photon server.
Hello pls help me how can i disconnect in the room after i connected. Because if i connect in the room if i call the main scene. I become disconnected in the room .
↧
↧
LoadBalancingApi can not serialize an array?
Hi, in order to combine packet as much as possible, I want to wrap my data into Dictionary[] and then send it to the server. But Unity Editor throws IndexOurOfRangeExceptions while trying to serialize it. Is that a bug or custom data has to be sent as a Hashtable?
Snapshot:
-----
CustomData:
var inputs= new List >();
foreach (var input in e.inputBuffer.Cached)
{
inputs.Add(input.ToDictionary());
}
var customDataToBeSent = inputs.ToArray();
-----
↧
PhotonServerPlugin How to use OnRaiseEvent ()
tl:dr
Hello. I am a beginner.
I am creating online games with SelfHosted PhotonServer and Unity.
All the tests are in my PC.
I want to do POST from PhotonServer (via HTTP) to Apache HTTP Server using Plugin, but it will not work.
When calling RaiseEvent with Unity, I think Plugin will be called, but is my recognition incorrect?
Or what kind of code is missing?
Setting
First of all, I built a plugin and a factory and then built it. I referred to the Plugins Manual and SDK samples. Sample [Photon-OnPremise-Server-SDK \ src-server \ Plugins \ TestPlugins \ SyncAsyncHttpTestPlugin.cs]//Plugin Class.
namespace Photon.Hive.Plugin
{
class PluginTest:PluginBase
{
public override string Name
{
get { return this.GetType().Name; }
}
public override void OnRaiseEvent(IRaiseEventCallInfo info)
{
if (info.Request.EvCode != 3)
{
var request = new HttpRequest
{
Async = info.Request.EvCode == 1,
Url = "http://192.168.1.5/myphp.php", //LocalHost
Callback = this.HttpRequestCallback,
UserState = info,
};
this.PluginHost.HttpRequest(request);
}
else
{
this.PluginHost.BroadcastEvent(ReciverGroup.All, 0, 0, info.Request.EvCode, null, 0);
}
}
private void HttpRequestCallback(IHttpResponse response, object userState)
{
var info = (IRaiseEventCallInfo)userState;
this.PluginHost.BroadcastEvent(ReciverGroup.All, 0, 0, info.Request.EvCode, null, 0);
}
}
}
//Factory Class.
using System.Collections.Generic;
namespace Photon.Hive.Plugin
{
public class PluginFactory : Photon.Hive.Plugin.IPluginFactory
{
public IGamePlugin Create(
IPluginHost host,
string pluginName, // name of plugin requested by client
Dictionary config, // plugin settings
out string errorMsg)
{
var plugin = new PluginTest();
if (plugin.SetupInstance(host, config, out errorMsg))
{
return plugin;
}
return null;
}
}
}
Next, I placed the build dll in Photon-OnPremise-Server-SDK \ deploy \ Plugins \ PluginTest \ bin.
Next, I added the following XML node to the file "Photon.LoadBalancing.dll.config" (Photon-OnPremise-Server-SDK \ deploy \ Loadbalancing \ GameServer \ bin)
After setting up so far, if you run PhotonServer (LoadBalancing (MyCloud) - Start as application) and check the log, it seems that the dll you created can be read well.
//Log(part)
2018-12-10 18:44:06,279 [1] INFO Photon.Hive.Plugin.PluginManager - Plugin Type Photon.Hive.Plugin.PluginFactory from assembly PluginTest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null was successfuly created
2018-12-10 18:44:06,303 [1] INFO Photon.Hive.Plugin.PluginManager - Plugin manager (version=1.0.15.11060) is setup. type=Photon.Hive.Plugin.PluginFactory;path=C:\MyPhoton\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Plugins\PluginTest\\bin\PluginTest.dll;version=1.0.15.11060
Next I wrote the code to send and receive RaiseEvent with Unity.
using UnityEngine;
public class PhotonManager : Photon.MonoBehaviour {
private enum EEventType : byte
{
Hello = 1,
}
private void OnGUI()
{
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
void Awake()
{
PhotonNetwork.OnEventCall += OnRaiseEvent;
}
private void Start()
{
PhotonNetwork.autoJoinLobby = true;
PhotonNetwork.ConnectUsingSettings("v2.0");
}
//Auto Connection.
void OnJoinedLobby()
{
Debug.Log("OnJoinedLobby");
string userId = UnityEngine.Random.Range(0, 100).ToString();
PhotonNetwork.AuthValues = new AuthenticationValues();
PhotonNetwork.AuthValues.UserId = userId;
// connect
RoomOptions roomOptions = new RoomOptions()
{
MaxPlayers = 20,
IsOpen = true,
IsVisible = true,
};
PhotonNetwork.JoinOrCreateRoom("room1", roomOptions, null);
}
void OnJoinedRoom()
{
Debug.Log("OnJoinedRoom");
}
//=========================================Raise=========================================
//Raise Send Button Event.
public void OnRaiseButton()
{
var option = new RaiseEventOptions()
{
CachingOption = EventCaching.DoNotCache,
Receivers = ReceiverGroup.All,
};
Debug.Log("Raise Send");
PhotonNetwork.RaiseEvent((byte)EEventType.Hello, "Hello!", true, option);
}
//Receive Raise.
private void OnRaiseEvent(byte i_eventcode, object i_content, int i_senderid)
{
var eventType = (EEventType)i_eventcode;
switch (eventType)
{
case EEventType.Hello:
Debug.Log((string)i_content+" SenderId:"+i_senderid);
break;
default:
Debug.Log("default");
break;
}
}
//========================================================================================
}
Finally, I set up the Apache side, I would like to access the following PHP file from PhotonServer via Apache.
<?php
echo "Myphp Test";
?>
Error that occurred
Launch Apache & Unity and Raise, the following Debug.Log will appear.
Raise Send
Operation 253 failed in a server-side plugin. Check the configuration in the Dashboard. Message from server-plugin: none of Photon.Hive.Plugin.RaiseEventCallInfo's method were called
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1625)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:161)
SenderId:-1
Also, the following error appears in 'Log' of PhotonServer.
ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - MissingCallProcessing for type:Photon.Hive.Plugin.RaiseEventCallInfo in Plugin:'Name:PluginTest, Version:1.0 AppId:C2A0-xxxxxxxx, AppVersion:'.
I tried google about the error that occurred, but I could not find anything.
In my code, it seems that the "Outbound HTTP Calls" section of the Plugins Manual is missing.
In that case, how should we incorporate OnHttpResponse () or PostJson ()?
What else should I add?
Thank you for reading.
↧
Globally Notification/Event
Hello team,
Please provide a solution for sending notifications/events to all the users connected to the server irrespective of their rooms or lobby.
Thanks
Ram
↧
Inventory Singleton Issue
Hello,
I am new using Photon PUN 2 and i am facing to an issue.
i am trying to implemente Inventory system
My inventoryManager is singleton evething work well but when i drop an item on the ground if i pickup it with an other player this item is always put back in the inventory of the player who throw this item.
i transfer ownership of the Object to the player who collier with but same thing, so maybe it's because my inventory is singleton but i don't understand how the gameobject can be placed back in the creator inventory because this inventory is not networked so there is 1 inventory Singleton on each client and each client have à knowledge about inventory singleton of other player
If someone can help me pls :)
↧
↧
Moved: Inventory Singleton Issue
This discussion has been moved.
↧
Issue with the Photon App Domain loading Dlls
I upgraded my nuget packages today and now when I try to run my photon application it is unable to load the correct version of the Microsoft.Extensions.Configuration.Abstractions. It tries to appear to load version 1.0.2.0 but we are on version 2.1.2.0. The dll is present in the dll and is the correct version(2.1.20) but I dont understand why Photon App Domain is not using the binding redirect like another .net framework application. The dll that hosts the ApplicationBase class is MGF.Photon.dll
Error message:
Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Extensions.Configuration.Abstractions, Version=1.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at MGF_Photon.PhotonApplication.Setup()
at Photon.SocketServer.ApplicationBase.PhotonHostRuntimeInterfaces.IPhotonControl.OnPhotonRunning()
at PhotonHostRuntime.PhotonDomainManager.PhotonPlainAppDomainBehavior.PhotonRunning()
at PhotonHostRuntime.PhotonDomainManager.PhotonRunning()
the binding redirect in the app.config file and in the MGF.Photon.dll.config
↧
How many messages a server can send each second?
Hi, I'm using OnPremise to develop a game, wondering how many messages a Server can send each second. Besides its bandwidth, is there any limitation like "Usually you can't send over 1000 messages for each CPU core per second"?
↧
What exactly does the 175$ plan give you?
What are you exactly paying for when you pay 175$ for the unlimited plan and then have to go pay another 80$ for a vps to actually host the onpremise server?
↧
↧
Staying in the same room
Im using the basic photon 2 demo pun basics room for 1
Id like all the players to be in the room for 1 instead of going into bigger rooms if more players enter.
What is the optimal way to change the code so that no matter how many players enter they stay in room for 1?
↧
GameServer is registered, can connect to Master Server but disconnect on creating room.
Hey there everyone :)
So I'm hosting photon on my Windows Server 2016
Using both TCP and UDP, I can safely connect to my server ip from Unity. However when I try to create a room I simply get Socketudp.Disconnect() as debug and I get "Game does not exist" error when I launch the test client on server.
Log from GSGame:
https://pastebin.com/A684TBu8
Log From MSMaster:
https://pastebin.com/G2kTtsRg
Also, when creating a room unity gives me "Failed parsing adress:"
full log:
Failed parsing address:
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1826)
ExitGames.Client.Photon.IPhotonSocket:Connect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/IPhotonSocket.cs:107)
ExitGames.Client.Photon.SocketUdp:Connect() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/SocketUdp.cs:64)
ExitGames.Client.Photon.EnetPeer:Connect(String, String, Object) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:267)
ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Object) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1116)
Photon.Realtime.LoadBalancingClient:ConnectToGameServer() (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:807)
Photon.Realtime.LoadBalancingClient:OnStatusChanged(StatusCode) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2320)
ExitGames.Client.Photon.<>c__DisplayClass100_0:b__0() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:893)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:429)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1428)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:130)
Can anybody point me to a correct configuration?
Photon server sdk v4
Unity Pun v2
Windows Server 2016
No custom ports. Actually no custom anything. Just downloaded, launched and set the ip to public.
Obfuscated my server address and username in the logs for obvious reasons.
Tried a lot of IP configurations in Photon.Loadbalancing.dll.config for both Master and GameServer folders but I still believe I may be missing something here.
Thanks a lot in advance :)
↧
only main can see other player
Only the game host can see the other player. The movements are also synced together. Any clue what this could be?
↧
Loadbalancing sample JoinGame failed (fixed)
I've setup an Amazon ec2
https://doc.photonengine.com/en-us/server/current/reference/faq#how_to_host_photon_server_on_amazon_
and am running the PhotonControl.exe on it. I've opened all the ports listed in the docs (even though it says it does it automatically?)
https://doc.photonengine.com/en-us/server/current/operations/tcp-and-udp-port-numbers
but I can't seem to connect. I've tried both as an application and as a service, using the public IP.
JoinGame failed: ReturnCode: 32758 (Game does not exists).
If I run PhotonControl and the TestClient on my local machine using the local IP it works fine. On the server both local and public IPs are not connecting using the TestClient, nor my local machines application.
Is this a port problem?
↧
↧
Moved: Second player can't connect to self-hosted server
This discussion has been moved.
↧
[Beginner] Using PUN + Photon Server who actually does the hosting?
Hi guys,
I am making a game with PUN and Server SDK, i just have a simple question, since im wrapping my head around server sdk, when you make a game using PUN and connect to a self hosted dedicated server, when you create the room, you are the Master Client, and the other guys who connect to your game are the Clients.
Does this mean that the processing and connection depends on the player who hosted? or using Photon Server means that even if i create the game, the actual connection is processed on the self hosted server?.
If im not clear enough, i want to use Server SDK on a VM so the connection is better, i dont want a player to host the game, i need to have 8 / 16 players, and i dont want a player to host, i want the google VM to host.
So if you create a game, you are hosting it too? or that is being hosted on the server vm?...
im still studying server sdk, so far so good, i can replicate what i did with PUN so...
↧
Getting NULL on photonView.Owner and "Player" class
Hi guys, using lastest server sdk v4-0-29-11263
enabled anon authentication
and i dont get Players, the thing is, photon voice crashes when instantiating event codes, OnEvent to be more precise, i cant get local id or other player ids
↧