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

[XboxOne] Build Errors on XboxOne after upgrading to 1.86.1

$
0
0
We Updated photon to the last version 1.86.1 and we are now experiencing compiling errors when building for XboxOne.

Here you have the compiler error:
Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs(204,25): error CS0117: `ExitGames.Client.Photon.SupportClass' does not contain a definition for `StartBackgroundCalls'

Anyone experiencing this?

Examples of ReconnectAndRejoin

$
0
0
I was wondering if there was an sample projects or examples of how to properly setup ReconnectAndRejoin? We are hosting our own Photon Server and I cannot seem to reconnect and rejoin the room. Everytime I reestablish a connection, I see the following error in our server logs:

2017-09-14 15:23:33,736 [28] WARN Photon.Hive.HiveGame - JoinApplyGameStateChanges: Game '7d108d42-6492-4129-9994-ff2563c5f259' userId '18b1f8d1-fc3e-4cb5-8b72-52336f0b3616' failed to join. msg:Join failed: UserId '18b1f8d1-fc3e-4cb5-8b72-52336f0b3616' already joined the specified game (JoinMode=3). -- peer:GameClientPeer: PID 185, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 9/14/17 8:23:33 PM in Room 7d108d42-6492-4129-9994-ff2563c5f259, IP 10.211.55.2:54526,

I have tried many variations of the PlayerTtl and nothing seems to work. I would love to see some examples of how this is supposed to be implemented.

Best,
Adam

Get Player Disconnected GameObject (PhotonView)

$
0
0
Hi !

I use OnPhotonPlayerDisconnected(PhotonPlayer player).
I want to get the gameobject that the player instantiated before he disconnected and leave the room.
How can i do it?

Thanks.

Controlling Unity from a C# client

$
0
0
Hi,
At this point I'm just using the beams tutorial to test my code.

I'm trying to control Unity (PUN) from a standard C# form in a self hosted server. I've got to the point where both are connecting to the same room, but Unity is getting warnings

Warning: Unhandled event Event 0.. Set PhotonNetwork.OnEventCall.
UnityEngine.Debug:LogWarning(Object)
NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:2609)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157

Is there a way to warn my Unity code that it should treat one of the clients differently?

Regards,
Steve

How to synchronize moving object by two player?

$
0
0
I am developing Multi-Player Air hokey game using PUN with Unity. So I have implemented synchronize of two players. But puck is not well. For example, one player hit the puck, it move to hit direct, but on the other player screen is not same moving. I don;t know how to resolve this problem. Who is help me? Thanks for your answers.

How to get callbacks when a friend's status changes?

$
0
0
I can PhotonNetwork.FindFriends(friendsArr), but I'd have to keep polling my entire list. It'd probably be better to just update 1 friend at a time:

Is there a way to subscribe to a callback when a friend's status has changed? Online / offline / in room / in lobby / [idle?]?

Is webhook SendState available in PUN and if so, how to send it?

$
0
0
Hello.
Our company is using PUN for our 6vs6 multiplayer fps-like game in late development.
We have a need to use RaiseEvent to fire a GameEvent webhook and send a full room state through, along with some serialized data. I have familiarized myself with both the Photon Realtime and PUN documentations. Although there is no mention of Webhooks in the PUN docs, I have succesfully configured our app account to send one when a GameEvent is fired and received it properly on the endpoint.
I have seen the use of SendState in the Realtime documentation and wanted to ask if it is possible to have similar behaviour in PUN. What I ultimately need are player usernames and possibly their custom properties or at least teams from the room state.

Here's how I achieved it in PUN
{ byte eventCode = 0; RaiseEventOptions options = new RaiseEventOptions(); options.ForwardToWebhook = true; PhotonNetwork.RaiseEvent(eventCode, "Testing webhook", true, options); Debug.Log("Sending event"); }
Hope to hear some advice on the subject and possibly tips on achieving my goal.
Thank you.

How to lock / unlock network objects by users correctly

$
0
0
Hi everyone, dear colleagues! Advise, please - I can't think up the solution of the task. I have a virtual furniture shop. The applicatuon must visually reflects a real condition of a warehouse and furniture in shop. The buyer can approach and "take" a chair (by touch to model). Respectively, other buyer isn't reported to buy it any more, it has to be blocked by the first.
...
I use the Photon. Advise, please, what mechanism it is possible to lock a subject that there were no conflicts of users - for example, repeatedly another couldn't buy the bought chair any more?
...
That is I so understand that both players have to send something to the master client, and master client has to solve to whom to give preference. Probably so somehow? And how to make it what methods in the Photon for this purpose are?
...
And still I wanted to ask: how it is correct to make that if the administrator of shop has changed something, this change would right there be displayed at all network players? For example, the administrator has decided to add a sofa (or to change for other model) - then all players have to see it at once. Here it is better for them to use the mechanism of the Photon? To use network prefabs of a scene? Or somehow differently?

Best regards!

My Game lags in the evening! WHY?

$
0
0
When I am playing my game with people after around 8pm UK time the game starts to lag really badly. Before 8pm there is pretty much no lag at all. This happens no matter who sets up the lobby and who is the masterclient in the game. We are all in the UK, using EU servers and all pretty much have over 150 meg internet connections. Infact we are all in the same city! Can anyone shed any light on this. It is really putting me off using PUN as it could kill my game before its every really had the chance to live!

Continue Coroutine of the previous Master Client

$
0
0
Hello !

For example there is 3 players in the room and when the game starts the master client checks if he can start the game. if he can start the game then the game start but have to wait for 10 seconds. I use yield return new waitforseconds(10f) and then he calls another RPC to start playing the game. I have problem while in the middle of waiting for 10 seconds and the master client leaves the room, the next rpc is not fired. Help please ! Below is the preview of my code :

[PunRPC]
public IEnumerator StartGame(){

if(PhotonNetwork.isMasterClient){

if(listPlayer.Count >= countStart){

photonView.RPC("EnableButton", PhotonTargets.All);

photonView.RPC("WaitingGame", PhotonTargets.All);

yield return new WaitForSeconds(10f);

//all the code below is not working if the master client leave before the 10 seconds waiting.

photonView.RPC("DisableButton", PhotonTargets.All);

....
....
...
...
...

}
}
}

how to get photon view or game object of owner

$
0
0
Hi
i have an scene object and i want to be able to get the game object of the current owner - is this possible? i ve searched for hours with no success.
thanks in advance for the help

Tell to other players, if a player internet connection is slow

$
0
0
Hi,
thanks to photon team for this great backend engine,
i was wondering how can i manage slow connections for other players, for example i have a realtime game it based on player speeds when a player disconnected from the internet other player can win the game easily, so i want to pause the game for 10 seconds after that if disconnected user couldn't connect again, other player wins

how can i do that ?

Cheers

Scene's physic objects synchronisation

$
0
0
Hi, I'm would like to have rigidbody objects in my scene (like balls, we could say) and every clients should be able to push those objects.
So the question is, how do I sync the physics or even the position in that case?

If the masterclient was the one synchronising the object, it would mean that every collisions must be calculated on the masterclient side and it would result in some serious lag for the other clients (imagine colliding with the ball and having to wait 0.5sec before having a physic reaction).
Is there a way for every client to send their own impact on the ball ? To make it easier, we can say that only the player's object (only one collider) can collide with the ball.

And just to be perfectly clear, if you played Overwatch, they have basketballs in some maps,every players can push them and there is an instant reaction. I would to have to same result.

Two Newbie questions

$
0
0
I asked in Unity forums but no one seems to be answering. I want to ask 2 questions related to PUN:

1) Hello, new to Networking, my first multiplayer game, a top-down 2D shmup arena.
I used PUN and everything runned smoothly eventually in my first attemps and tests except a thing. The shmup ships move around and one sees another move smoothly. But a small, a bit lag seems to be created as the game runs and gets bigger and bigger over time. This leads to jumps in the "other" ships' movement about at the 5 minute mark.
I live in Greece and set up the preferences to EU Photon Server. I also tested this to different connections, so I don't think it is a "my" connection problem.
The player observes only one script nested to the "other" ships gameobjects which is the following:
using UnityEngine;
using System.Collections;

public class NetworkCharacter : Photon.MonoBehaviour {

Vector3 realPosition = Vector3.zero;
Quaternion realRotation = Quaternion.identity;


void Start () {

}


void Update () {
if( photonView.isMine ) {

}
else {
transform.position = Vector3.Lerp(transform.position, realPosition, 0.1f);
transform.rotation = Quaternion.Lerp(transform.rotation, realRotation, 0.1f);
}
}

public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
if(stream.isWriting) {


stream.SendNext(transform.position);
stream.SendNext(transform.rotation);
}
else {


realPosition = (Vector3)stream.ReceiveNext();
realRotation = (Quaternion)stream.ReceiveNext();
}

}
}

There are of course 2 other scripts in the ship, one for movement and rotation, and one for camera, but those are not observed.
Anybody has an idea?



2) Furthermore, are there series of up to date video tutorials that explain all the features of PUN? There are some in in Photon website as links, but they are from like 2014. Should I trust them?

Problem with RaiseEvent() and PhotonPlayer[]

$
0
0
Hi guys,

I'm trying to pass a PhotonPlayer[] as a "content" argument in my RaiseEvent() but it seems like PhotonPlayer arrays aren't included in Photon Custom Types.

Do you have any idea on how it could be done alternatively?

Is PUN the right choice for dedicated servers?

$
0
0
Hello, I'm currently looking into converting my singleplayer survival game into a multiplayer survival game on Unity where players will be able to host dedicated servers from their home PC or from actual server providers such as gameservers and etc.. I'm interested to hear if PUN is capable of doing this and if so am I still locked into the CCU cap even if all the servers are hosted by me and other players.

Updating private data on one player's client

$
0
0
Each player has an "inventory" list of data that nobody else needs to see. This list is maintained in a separate WCF data service / DBMS. A player can "give" an object to another player via WCF (i.e. make a call that adds the object to the other players list in the database). How do I then cause the receiving player to refresh their list (by querying the WCF service)?

The WCF/DB stuff is probably irrelevant (just for context) - basically I just need one player to tell another specific player's client to run some code! :-)

Thanks!

How to handle error 32746 (already joined)?

$
0
0
There are some rare cases when my users get disconnected and when they try to rejoin, PUN answers with an error code 32746.

In documentation:
(32746) for join requests. Indicates the list of ActiveActors already contains an actor with the requested ActorNr or UserId.
public const int JoinFailedFoundActiveJoiner = 32746;

However, if I assume that user joined the room after that, PhotonNetwork.room is null and everything after that crashes and burns.

What do I have to do to successfully rejoin? Call JoinRoom()? Call ReconnectAndRejoin() ?

Cache only the last event on the server sent with PhotonNetwork.RaiseEvent

$
0
0
In my new game I use events to synchronize the game state between players. The state of a player can be encoded compact in only 1 event. That is why I send every time the whole state of the player.
When a new player joins the room, the easiest way to synchronize the other players with him is to send him the last event of every other player. I thought I can do this with event caching on the server side. The idea is to cache on the server only the last event sent and then send it automatically to the new joined players.

In other words, I want to replace the cached event every time on the server, but I saw that EventCaching.ReplaceCache is obsolete now! Is there an alternative to cache only the last event on the server?

If I use EventCaching.AddToRoomCache all events are cached and then send to the new player -> bad.
I also don't want to send an extra delete event every time. My game should support up to 20 player and already operates close to the 500 msg/sec per room limit.

All PhotonView will recieve the RPC ?

$
0
0
Hi everybody !

I would like to know like I said in the title if all they object recieve the rpc from player ?

To save message /s , I use my own system to send movement via rpc to other player

And in my room , I have some other object with photonview like a chest , or monter

So when a player move , RPC is send to all photonview no ?

There is a way to send some rpc only to player and not to object with photonview ?

Thanks for reading me and have a good day!
Viewing all 8947 articles
Browse latest View live


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