i am using sdk photon server , And i want to send data from Server to Clients like it:
public class UserInfo: System.Object {
[SerializeField] protected int _id;
[SerializeField] protected string _name;
[SerializeField] protected int _level;
public UserInfo(int id;, string name;, int level;) {
this._id = id;
this._name= name;
this._level = level;
}
So, i tried some ways, but incomplete :( .
↧
Serializable Data on Server Size
↧
Loadbalancing sample JoinGame failed
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?
↧
↧
Second player can't connect to self-hosted server
Hello everyone. I am developing a simple tic-tac-toe game to learn basics. I programmed the main logic and game works on Photon Cloud. I followed the PUN introduction tutorial for making the game. When first player connect to server it creates room and wait for the other player. When second player enters the room the game starts and runs perfectly.
Hovewer, I decided to move to self-hosted server. I started a VM on Azure and configure required ports. Now, the first player can connect to server and create a room but when second player hits the "play" button, nothing happens. Only OnConnectedToMaster() works and logged at "Console" but nothing more. I wonder why the game works with Photon Cloud but not with self-hosted server, is there any possible reason. Thanks for your time.
↧
Ease/difficulty of running PUN on dedicated server running CentOS 7
hi, i just signed up for the free version of PUN, which i intend to use for my multiplayer games. can someone with experience in the area tell me how hard/easy it is to use PUN with a dedicated server on the Internet?
↧
loading a self server license by command line
How do you load a license by command line.
↧
↧
Moved: Second player can't connect to self-hosted server
This discussion has been moved.
↧
Moved: Ease/difficulty of running PUN on dedicated server running CentOS 7
This discussion has been moved.
↧
Photon Server not start
Hi, I'm a beginner to custom server.
I have the photon server up but when I start the custom service the server starts for a few seconds then shuts down.
↧
Destroying Rooms
Is there a way to destroy rooms created on a locally hosted Photon Server?
I need a way to bypass the RoomOption.EmptyRoomTTL sometimes and destroy the room immediately.
↧
↧
Using enforceFIPSPolicy?
Hi. I'm new to Photon and hoping someone here has some experience with my issue. The company I work for requires FIPS to be enabled on all computers, though documented exceptions for individual programs are allowed.
To do so, I've found that there is an enforceFIPSPolicy element that can be nested within the runtime element in the config file of whichever specific program I'm running that I can use to disable it. Determining which of the Photon config file I need to update is where my question lies.
I start the server using PhotonControl.exe, so my thought is to add it to the PhotonControl.exe.config file, however there is no runtime element within that file. Since the service is actually the PhotonSocketServer, I would guess it would go in a PhotonSocketServer.exe.config file, but this file does not exist. The closest match is PhotonServer.config.
Has anyone used this element, particularly with Photon? Did it work as expected, and which config file was it placed in?
Thanks in advance for your help.
↧
Local host LoadBalancing server can't creat room
When I Extract Zip,and run loadBalancing without any change of configuration,can't creat room.Whatever by TestClient or by PhontonNetwork.creatroom. I'm sure all Ip are "127.0.0.1".I need help.
Here is TestClient Log:
I:\PhotonServer\Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\bin_tools\stardust.client\
Test case: Master
Settings: 5 games per process, 3 players per game, game server at 127.0.0.1:5055
Sending reliable operation every 100 ms
Starting 5 games with 3 players
[14312] Press Return to End
Connecting to 127.0.0.1:5056
[14312] Started game DESKTOP-P403K88(14312)1 with 3 clients
OnOperationReturn: CreateGame failed: ReturnCode: 32752 (Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : '未能解析此远程名称: 'photon-photon-pluginsdk-v1.webscript.io'' httpcode=-1 webstatus=1 response='', HttpQueueResult=5.). Disconnecting...
[14312] Started game DESKTOP-P403K88(14312)2 with 3 clients
Connecting to 127.0.0.1:5056
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
OnOperationReturn: CreateGame failed: ReturnCode: 32752 (Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : '未能解析此远程名称: 'photon-photon-pluginsdk-v1.webscript.io'' httpcode=-1 webstatus=1 response='', HttpQueueResult=5.). Disconnecting...
Connecting to 127.0.0.1:5056
OnOperationReturn: CreateGame failed: ReturnCode: 32752 (Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : '未能解析此远程名称: 'photon-photon-pluginsdk-v1.webscript.io'' httpcode=-1 webstatus=1 response='', HttpQueueResult=5.). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
[14312] Started game DESKTOP-P403K88(14312)3 with 3 clients
Connecting to 127.0.0.1:5056
OnOperationReturn: CreateGame failed: ReturnCode: 32752 (Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : '未能解析此远程名称: 'photon-photon-pluginsdk-v1.webscript.io'' httpcode=-1 webstatus=1 response='', HttpQueueResult=5.). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
[14312] Started game DESKTOP-P403K88(14312)4 with 3 clients
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
Connecting to 127.0.0.1:5056
OnOperationReturn: CreateGame failed: ReturnCode: 32752 (Failed to create game on http://photon-photon-pluginsdk-v1.webscript.io/GameCreate? : '未能解析此远程名称: 'photon-photon-pluginsdk-v1.webscript.io'' httpcode=-1 webstatus=1 response='', HttpQueueResult=5.). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
[14312] Started game DESKTOP-P403K88(14312)5 with 3 clients
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...
↧
how do u use loadbalancing in photon server?
Hi, I'm a absolute beginner to photon server, not photon cloud. But I want to make the simple multiplayer game by using the LoadBalancing application in photon server. Unfortunately, there are many questions such as User authentication from the first time.
First, I know that photon v4 supports user authentication now. is this true? if so, i want to know about this in detail.
Second, i think that load balancing code structure is very complex. if i insert the game logic into that, where do i insert the game logic into?
I hope ur great and detail help. thank u.
↧
Async Operations in Server plugins
What is recommended for use in server plugins for asynchronous web operations?
I have analytics functions that get sent out to playfab for various things, and I'm currently using ThreadPool.QueueUserWorkItem. Is there a preferred method for fire and forget async operations such as these that would be friendlier to the server?
↧
↧
AuthenticationValues, SetAuthPostData and Custom headers
Hi,
we need to send some custom headers within
AuthenticationValues
. The values of the headers are always different for the user. Due to that we cannot use the global CustomHttpHeaders
which can be setup in the admin area/e.g. .config file.
Do you have an idea how we can do this?
↧
PhotonNetwork.ConnectToMaster With Local Server/Computer Name
Hi,
we are currently testing a local cloud scenario with a PUN Server in a local network. The clients which are all inside this network should connect to this server via the
PhotonNetwork.ConnectToMaster
command. At this time we do not know the IP address, but the name of the Server. The IP address are chaning from time to time (server restart/shutdown). Therefor we can not enter a static IP address/configurate it inside the .config files.
Do you have an idea, how we can use a Computer Name like "MyPunServer" to connect to the Server (including a correct setup for the .config files)?
Or if this is not possible, do you have a workaround?
Thank you.
↧
One server only, one room only and not offline mode?
Hello, first of all i use a translator (google translation) so english will be very bad!
I would like to know if it is possible to have only one server, one room? I want to make an online game where everyone will be in the same server, for the tests I use the 20 slots free and then I will enlarge later.
I do not know if photon is planned for that? Or should we simply create a room and keep it always open? I really want to ban the creation of room (against hacks) and not be able to play the game offline.
Thank you for your help!
Ps: I'm a beginner I already had a lot of trouble finding the tutorial for PUN 2 for custom authentication. (Then it's a little easier for the creation of players etc, even if I still have trouble understanding where I have to program the server actions).
For example, a player opens a chest, everyone receives it, etc.
I think there is RPC similar to Unity for that? Well, I have not looked at it yet!
↧
Server Load & Performance question
Hello, I'm developing a fast-paced arena FPS with Unity & Photon Server. I was just curious about our performance:
Since it's a fast-paced game (Max 16 players - 8v8) with compact maps so some kind of action happens every second, which means that lots of operations must be sent.
For example: We have a specific operation for damage register event which is sent everytime a hit detection system returns a possible hit to another player. It first serializes a custom type to a byte array and then passes it over for the server to handle.
The custom type looks like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ExitGames.Client.Photon;
using System.IO;
[System.Serializable]
public class ServerWeaponDamageEvent {
public int ActorID;
public byte ActorCurrentWeaponID;
public byte Critical;
public float TimeSent;
public Vector3 Direction;
///
/// Serializes this custom type into a byte array.
///
/// The binary data.
///
public static void Serialize(Stream stream, ServerWeaponDamageEvent instance)
{
int num = 0;
using (MemoryStream memoryStream = new MemoryStream())
{
IntProxy.Serialize(memoryStream, instance.ActorID);
ByteProxy.Serialize(memoryStream, instance.ActorCurrentWeaponID);
ByteProxy.Serialize(memoryStream, instance.Critical);
SingleProxy.Serialize(memoryStream, instance.TimeSent);
Vector3Proxy.Serialize(memoryStream, instance.Direction);
IntProxy.Serialize(stream, ~num);
memoryStream.WriteTo(stream);
}
}
///
/// Deserializes this custom type from a byte array.
///
/// The custom type object.
///
public static ServerWeaponDamageEvent Deserialize(Stream bytes)
{
int num = IntProxy.Deserialize(bytes);
ServerWeaponDamageEvent damageEvent = new ServerWeaponDamageEvent();
damageEvent.ActorID = ByteProxy.Deserialize(bytes);
damageEvent.ActorCurrentWeaponID = ByteProxy.Deserialize(bytes);
damageEvent.Critical = ByteProxy.Deserialize(bytes);
damageEvent.TimeSent = SingleProxy.Deserialize(bytes);
damageEvent.Direction = Vector3Proxy.Deserialize(bytes);
return damageEvent;
}
}
After that has been sent and server has processed it; a DamageInfo class will be serialized as well and sent back to the client as an event.
The DamageInfo looks like this:
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
[System.Serializable]
public class ServerDamageInfo
{
public int DamageAmount;
public PlayerHitboxType BodyPart;
//This is not handled currently by the server.
public float UpwardsForceMultiplier = 150f;
public Vector3 Force;
public bool IsExplosion;
///
/// Serializes this custom type.
///
/// The binary data.
///
public static void Serialize(Stream stream, ServerDamageInfo instance)
{
int num = 0;
using (MemoryStream memoryStream = new MemoryStream())
{
IntProxy.Serialize(memoryStream, instance.DamageAmount);
ByteProxy.Serialize(memoryStream, (byte)instance.BodyPart);
Vector3Proxy.Serialize(memoryStream, instance.Force);
BooleanProxy.Serialize(memoryStream, instance.IsExplosion);
IntProxy.Serialize(stream, ~num);
memoryStream.WriteTo(stream);
}
}
///
/// Deserializes this custom type.
///
/// The custom type object.
///
public static ServerDamageInfo Deserialize(Stream bytes)
{
int num = IntProxy.Deserialize(bytes);
ServerDamageInfo damageEvent = new ServerDamageInfo();
damageEvent.DamageAmount = ByteProxy.Deserialize(bytes);
damageEvent.BodyPart = (PlayerHitboxType)ByteProxy.Deserialize(bytes);
damageEvent.Force = Vector3Proxy.Deserialize(bytes);
damageEvent.IsExplosion = BooleanProxy.Deserialize(bytes);
return damageEvent;
}
}
I was just wondering since it's a fast-paced game and many players, for example could be registering hits to another player with rapid-fire machine guns. How much would these kinds of actions cost performance wise (mostly network-traffic)?
Here are some specifications of our server:
OS: Microsoft Windows Server 2016 Standard 64bit
CPU: Intel Xeon CPU E3-1246 v3 @ 3.50GHz, 4 cores
RAM: 32gb 1600Mhz
Network: 1gbps
Thanks in advance,
Samuel
↧
↧
Saving a many-to-many webcam stream server-side
Hi,
I am making a many-to-many webcam app in Unity using the StreamSDK plugin.
I have a working prototype connecting to Photon Server.
The reason why I choose Photon Server instead of the Cloud solution is that I need to capture/save the multi-stream server side.
In my head I have two solutions on how to approach this, and I would like some pointers from the community if my thinking is on the right track.
Solution 1:
- Photon Server is capable of capturing the different streams, and combining them and saving them server-side. This would be programmed in a Plugin.
Solution 2:
- The master client in Unity captures the screen and audio, and sends it to the server, where it is stored as a video file. This is also done in a Plugin I think?
I prefer Solution 1, because 2 is more heavy on the client.
Any pointers and tips on how to approach this would be very appreciated!
Thanks!
↧
Automatically Reconnecting on Leaving Room
So i am trying to leave a room so when i leave it i reconnect automatically
here is the Code i am using
// Called from a button or somewhere external
public void LeaveRoom()
{
PhotonNetwork.LeaveRoom();
}
public override void OnLeftRoom()
{
PhotonNetwork.DestroyPlayerObjects(PhotonNetwork.player);
SceneManager.LoadScene(1);
}
↧
Photon Loadbalancing Errors Spam
Hello.
I am using Photon Server. Periodically I can see the "Can't optimise broadcast to disparate peers" error. I couldn't find anything on google. So does anybody know what problem it is and how to fix it?
Sometimes clients can't connect to master for 10+ minutes. I think that this error can be the source of my problem
↧