Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all 8947 articles
Browse latest View live

PUN behind Proxy Server

$
0
0
Hello photon community,

I'm developing a unity application (PUN) which communicates with a self hosted photon server.
Since our customers are sitting behind a proxy server, there are some problems i have to fix.

During the developing process i tryed to simulate our customer's situation:
- block all outgoing and incomming connections in my firewall
- allow only connections via specific port
- set the windows proxy server settings (system control / internet explorer) to the ip and port of the proxy server

For testing i use three pcs:
- one for the PUN client
- one with WinGate (http://www.wingate.com/) installed as our proxy server
- one for the photon server

Unfortunately i'm not able to connect to the server.
I tryed several things but nothing fixed the problem...
- changing the port of client and server to port 80 (because i just allow port 80 in my firewall and in the proxy)
- changing protocol from udp to tcp
- using tools like sshh (https://sourceforge.net/projects/sshh/) or http-tunnel (http://http-tunnel.sourceforge.net/)

When using chrome the proxy will log the connections.
When using the www class in unity the connections will be logged.
When disable the proxy settings all connections will be blocked...

Because i have not enough knowledge about all the stuff, i am at my wit's end.

Is there a possibility to enable proxy settings like Network.useProxy in unity's native networking api?

Thanks in advance and best regards
Daniel

Photon for mmo?

$
0
0
Hey there,
is there a way to create a "static" server that doesn't close and deletes everything when everyone has left?
Need this for a small mmo project :)

Animator usage issue

$
0
0
Hello everyone.
I am trying to create gameobject with synchronized position and rotation using photon. I use TrasnformView and RigidBodyView to do that. Also i want to play different animations on each client, the object has idle animation and some others with boolean conditions. The idle animation works perfect, but when i call Animator.SetBool() at one client to change animator state, it seems trying to sync animation frames over photon.
Sorry for bad language, could you help me and give some advise? What i am doing wrong?

Do I have to change anything in my source code when I upgrade a plan?

$
0
0
Hello,

We have a game developed in Unity3d, it only has 20 CCU. We want to upgrade to a higher CCU. Do we have to change anything in the source code or we leave the source code as it is and just go ahead and buy a new plan?

While debugging, hierarchy does not update

$
0
0
Hello to the Photon community,

For those who know UFPS, i'm using the helipad map demo from this package https://www.assetstore.unity3d.com/en/#!/content/33752, that provides PUN.

The scene is basically a simple lobby that load the game once clicked and instantiate a player/camera everytime someone connects.

The problem is that this camera being instantiated dynamically, I'm trying to find where it's instantiated in the code but I have no clue because of the Hierarchy that doesn't update.

When I attach the Visual Studio IDE to Unity Play, the hierarchy panel isn't updated anymore while debugging. So i can't watch my hierarchy popping the new Camera and I can't evaluate which portion of code is making this.

Have you ever been confronted to that problem ? Do youknow how to solve this or do you have an alternative ?

Thanks.


Is GetPing waiting to be finished to launch the next line ?

$
0
0
Just a simple question, can I use GetPing to wait for a line of code or a function to start?

PhotonNetwork.GetPing ();
Debug.Log ("Executed after receive the ping");

So if i have 500ms, the debug log should start instant when the ping return.

Players after join romm dont see builds

$
0
0
hello all,

Weel clone builds dont create for player after join another room if others players have build, but after connect is good , problem is if anoher join dont go see was build ;( but if are connect is good

Script PhotonPlayerHandlers

public class PhotonPlayerHandlers : Photon.MonoBehaviour
{
#region Private Fields

private PhotonHandlers Handlers;

#endregion Private Fields

#region Private Methods

private void Awake()
{
Handlers = FindObjectOfType<PhotonHandlers>();
}

private void Start()
{
if (!photonView.isMine)
{
if (PhotonNetwork.isMasterClient)
{
if (Handlers != null)
{
photonView.RPC("RequestSyncPlacement", PhotonTargets.AllBuffered);
}
}

return;
}

SimpleCampfire.OnInterracted += OnInterracted;
EbsEvents.OnBuildPrefabPlaced += OnPrefabPlaced;
EbsEvents.OnBuildPrefabDestroyed += OnPrefabDestroyed;
}

private void OnInterracted(EbsPrefab prefab)
{
if (prefab == null)
{
return;
}
}

private void OnPrefabPlaced(EbsPrefab originPrefab, EbsPrefab placedPrefab)
{
if (!photonView.isMine)
{
return;
}

if (placedPrefab == null)
{
return;
}

placedPrefab.EntityInstanceId = placedPrefab.GetInstanceID();

if (Handlers != null)
{
photonView.RPC("RequestNewPlacement", PhotonTargets.OthersBuffered, placedPrefab.Id, placedPrefab.GetInstanceID(), placedPrefab.transform.position, placedPrefab.transform.rotation, false);
}
}

private void OnPrefabDestroyed(EbsPrefab prefab)
{
if (!photonView.isMine)
{
return;
}

if (prefab == null)
{
return;
}

if (Handlers != null)
{
photonView.RPC("RequestNewDestruction", PhotonTargets.OthersBuffered, prefab.EntityInstanceId);
}
}

#endregion Private Methods

#region Public Methods

#region Rpcs

[PunRPC]
public void RequestSyncPlacement(PhotonMessageInfo info)
{
foreach (EntityData PrefabData in Handlers.NetworkEntities)
{
if (PrefabData != null)
{
if (PhotonNetwork.isMasterClient)
{
return;
}

EbsPrefab PrefabTemp = EbsManager.Instance.GetPrefab(PrefabData.Id);

PrefabTemp.EntityInstanceId = PrefabData.InstanceId;

Instantiate(PrefabTemp.gameObject, PrefabData.Position, PrefabData.Rotation);
}
}
}

[PunRPC]
public void RequestNewPlacement(int prefabId, int instanceId, Vector3 position, Quaternion rotation, bool sync, PhotonMessageInfo info)
{
Handlers.AddNetworkEntity(new EntityData(prefabId, instanceId, position, rotation));

EbsPrefab PrefabTemp = EbsManager.Instance.GetPrefab(prefabId);

PrefabTemp.EntityInstanceId = instanceId;

Instantiate(PrefabTemp.gameObject, position, rotation);
}

[PunRPC]
public void RequestNewDestruction(int instanceId, PhotonMessageInfo info)
{
Handlers.RemoveNetworkEntity(instanceId);

foreach (EbsPrefab prefab in FindObjectsOfType<EbsPrefab>())
{
if (prefab != null)
{
if (prefab.EntityInstanceId == instanceId)
{
Destroy(prefab.gameObject);
}
}
}
}

#endregion

#endregion Public Methods
}




- SCRIPT PhotonHandlers


public class PhotonHandlers : Photon.MonoBehaviour
{
public List<EntityData> NetworkEntities = new List<EntityData>();

public void AddNetworkEntity(EntityData data)
{
if (!PhotonNetwork.isMasterClient)
{
return;
}

if (data == null)
{
return;
}

NetworkEntities.Add(new EntityData(data.Id, data.InstanceId, data.Position, data.Rotation));
}

public void RemoveNetworkEntity(int instanceId)
{
if (!PhotonNetwork.isMasterClient)
{
return;
}

foreach (var Entity in NetworkEntities)
{
if (Entity != null)
{
if (Entity.InstanceId == instanceId)
{
NetworkEntities.Remove(Entity);

break;
}
}
}
}

}


tobias Please help me

IPv6 for Unity iOS Exports

$
0
0
Apple now requires iOS apps to support pure IPv6 connections.
We tested PUN v1.75 and it supports IPv6, including the "Best Region" setting.

If you use the Photon Cloud, you only have to make sure your PUN version is up to date.
If you run a Photon Server, you might have to update.

Test All Builds

Unity's support for IPv6 begins with 5.3.4p4. They posted about adding IPv6 support.

Several versions of Unity do not successfully support IPv6, so you should test each build.

If you get a client-side error like this, your client needs an update;
Connect() to 'x.x.x.x' failed: System.Net.Sockets.SocketException: Network is unreachable in a IPv6 network.

Test Procedure

Read "Test for IPv6 DNS64/NAT64 Compatibility Regularly" to learn how to test IPv6 support easily.

We do this for PUN before release.
Make sure there is not some other plugin failing!

Handling Rejections

We know that some apps got rejected, despite using PUN v1.75.

If your app gets rejected, please get in touch with the Apple review team. Point out that you're using PUN and that we and you both tested the netcode versus their own test procedures.

Explicitly point to their own test-description page. If our tests fail and theirs doesn't, we have to figure out what we have to test! At the moment, it's unclear.

Cloud and Server

The Photon Cloud itself will not be directly available via IPv6 in the short term. Apple's requirement is that clients can cope with IPv6 addresses, if there is a "IP translation", as described in their article.

For anyone using Photon Server (OnPremise), this means, you can likely continue to run it as IPv4 service.
If you want to setup a true IPv6 server, we have some docs for that.



Get Photon Unity Networking in the Asset Store.

OnJoinedLobby not seem to being called?

$
0
0
Calling PhotonNetwork.ConnectUsingSettings() works perfectly. The console clearly prints that it connects to the US-Server. Auto-Join Lobby is indeed, enabled, however my PhotonNet(implements Photon.PunBehaviour) does not call
public override void OnJoinedLobby().
It simply will not call! I have it overridden, and have it printing to the console, but it won't print.
Any suggestions? Thanks!

Exception: deserialize(): 1 Error

$
0
0
Hi, We are on v1.71, the code which output the above error had been running stably for a long time. However, today this error occur on the client side, with very little information to go on with, here is the call stack

Exception: deserialize(): 1
ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, Byte type)
ExitGames.Client.Photon.Protocol16.DeserializeObjectArray (ExitGames.Client.Photon.StreamBuffer din)
ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, Byte type)
ExitGames.Client.Photon.Protocol16.DeserializeHashTable (ExitGames.Client.Photon.StreamBuffer din)
ExitGames.Client.Photon.Protocol16.Deserialize (ExitGames.Client.Photon.StreamBuffer din, Byte type)
ExitGames.Client.Photon.Protocol16.DeserializeParameterTable (ExitGames.Client.Photon.StreamBuffer stream)
ExitGames.Client.Photon.Protocol16.DeserializeEventData (ExitGames.Client.Photon.StreamBuffer din)
ExitGames.Client.Photon.PeerBase.DeserializeMessageAndCallback (System.Byte[] inBuff)
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
PhotonHandler.Update () (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)

We roll the code back several days and we still the error. Would anyone be kind enough to suggest a hint if they have any?

Thanks!
David

Nulled Error on IOS

$
0
0
Hello guys i upgrade my unity 5.5 f3 i can create room and play on unity editor but I cant play ios device thats error this code

referenceTime = (float)PhotonNetwork.room.customProperties["RefTime"]

NulledreferenceException error

I just get error only ios device :S Please Help me !

standalone server for webgl

$
0
0
Is it possible to use standalone server for webgl??

Trouble with PUN [Operation failed: OperationResponse 225: ReturnCode: -1 (Unknown operation code 2]

$
0
0
HI guys!

I have some problem with PUN.

I've download it from Asset Store. Make some changes on scene (I've added some prefabs / meshes / scripts to level)

I even was able to built the project to different platforms. But now it's haven't working.

The error log in the screenshot


Find Host

$
0
0
Hii. I am new in Photo Unity network. is there any way to find host of the game??

Reconnecting to a Photon room after client timeout

$
0
0
Hi,

I am trying to re-establish a connection to photon for players when they lose connection to the server. I'm only roughly starting out with this so far, but hit an issue I'm not sure about. So when I get notified that Photon has disconnected due to client timeout, I have tried making a call to ConnectWithSettings() again to reinitialise everything, but I'm getting an warning message from Photon:

ConnectUsingSettings() failed. Can only connect while in state 'Disconnected'. Current state: 6

I've looked all over the documentation, but I have no idea what state 6 is or why it's set to this.

I'm assuming this isn't the way to reconnect to the server anyway judging by this output, so what should I be doing? I have cached the room name already and will call PhotonNetwork.JoinRoom(_roomName); once I have reconnected again.

High ping.

$
0
0
Hi.
I'm connecting to PUN from PK on a 10mb connection with 46ms ping on speedtest.
Doing a ConnectToBestCloudServer connects me to EU where I get about 170ms with PhotonNetwork.GetPing() and 157ms with ping command on windows.
Is this normal? Since PhotonNetwork.GetPing() gives a RTT, should I divide it by 2 to show it to the users?
Thanks.

Probably dumb question: How is a multiplayer game that trusts clients secure?

$
0
0
I'm coming back to my first multiplayer game development after 7 years, so pardon the history here, but I coming back to the world of multiplayer I'm lost and feel like I'm missing something.

The last multiplayer games I did were a Flash frontend with Smart Fox Server. Smart Fox was an authoritative server, I coded the game code in Java on the server side, and the clients were trusted only to send input and update displays. 7 years ago, if you released a multiplayer flash game without an authoritative server, one that trusted it's clients, the very second you became popular the cheatengine guys would have you game hacked and you're game was shot.

Now I'm making a Unity multiplayer game and all of the primary recommendations (UNET, or Photon PUN here, others) are based on trusted/master clients. I must be missing something, how does this ever work? Do hackers not care anymore, or is there some security layer I'm not understanding?

My inclination is to go right to Photon Server, since it's the authoritative server model I'm familiar with, but I also feel like I'm missing information since so many people are using client based solutions.

Thanks for any help!

Plugin: ActorNr always 0

$
0
0
I'm writing a Photon plugin and I'm noticing my ActorNr is always 0 for every connection. Could somebody please shed some light as to why this is happening? I'm looking for a unique ID for each connection

Thanks,
Adam

PUN v1.80 NotImplementedException when switched auth mode to "AuthOnce" on WP8.1

$
0
0
Hi,

I am getting this exception after I switched auth mode to AuthOnce and deployed to windows phone 8.1 device.


NotImplementedException: The method or operation is not implemented.
at ExitGames.Client.Photon.PeerBase.InitEncryption(Byte[] secret)
at ExitGames.Client.Photon.EnetPeer.InitPeerBase()
at ExitGames.Client.Photon.EnetPeer.Connect(String ipport, String appID, Object custom)
at ExitGames.Client.Photon.PhotonPeer.Connect(String serverAddress, String applicationName, Object custom)
at NetworkingPeer.ConnectToRegionMaster(CloudRegionCode region)
at PhotonNetwork.ConnectToRegion(CloudRegionCode region, String gameVersion)
at NetworkManager.d__5.MoveNext()
at UnityEngine.Internal.$MethodUtility.$Invoke1217(Int64 instance, Int64* args)
at UnityEngine.Internal.$MethodUtility.InvokeMethod(Int64 instance, Int64* args, IntPtr method)
(Filename: Line: 0)


AuthOnce works in editor and it works when deployed to android device.
Using:
PUN v1.80
Unity 5.3.4f

When I use auth mode "Auth" it works on windows phone device as well.

I believe currently used dll is from Metro folder. Am I missing something? Should I use some other dll that contains this implementation?

Failing to Connect to Popular rooms?

$
0
0
Recently the more users in a room the harder it is for other players to enter. I debug everything and it appears that trying to load into these rooms continuously disconnects from the server ( I have it set up that users will reconnect automatically if disconnected, so it's an endless loop of disconnecting and reconnecting in an attempt to join the room from the lobby.

I've set my max players for any room to 0 and then I set it to 100 just to be totally sure it's not the max player number, Generally once a room has more than 5 people in it other players trying to connect have a lower chance of getting in if at all. Some players DO make it through after multiple tries, but it seems nearly impossible from the debugging side of things.

I also recently get the QueueIncomingReliable error now for trying to get into a room once I changed the max players setting. Is there a way I can possibly set some kind of period in between players recieving player information when they log in (Everyone calls all their important information on start so it all comes in at once and doesn't send again) Or possibly temporarily set serialization to be unreliable until a player joins and then reliable after they're in?

I'm unsure what to do, especially since I have 100 CCU but we're not going over 40 players in game at any moment.
Viewing all 8947 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>