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

EventCaching' does not exist in the current context

$
0
0
public void SendTurnNumber(int num)
{
Debug.Log ("Send Turn Number");
Hashtable content = new Hashtable();
content[(byte)50]=num;
this.loadBalancingPeer.OpRaiseEvent(EvSendTurnNumber, content, true, new RaiseEventOptions() { CachingOption = EventCaching.AddToRoomCache });
}

it shows error The name `EventCaching' does not exist in the current context
What is the reason for this error

RPC Not Calling All PhotonView's Across Network

$
0
0
Hi there, I am a newb
However, I think I have built a fairly sturdy circuit. My issue is that, in a 2 player, multi player setting, at player x wins, I send a message via the winning player photonView.RPC("RoundWon", PhotonTargets.All, thisPlayerID);

This works, except that the only object to recieve the news is the slave, or mirrored or remote object of the winner. The loser, player, remote or local, does not seem to get the message.


I am at a bit of a loss.

I have started looking into RaisedEvents, but the arguments, to me are a bit confusing. Can someone help me out?

Thank you

Photon Rally Tutorial

$
0
0
Hello,
I recently purchased the game Photon Rally Tutorial from the Asset store. Apparently, the game has a lot of errors that i can't fix. Could kindly enlighten me on how to fix them and start the game?

Thank you

STEAMVR Tracking Controllers Help!

$
0
0
Hello all,

I have been trying for the past few days to have the steam vr controllers synced in my multiplayer game where one user sees the other user. Right now when two users are in a room, each user is controlling the others controller, but it's only for their respective view.

Any help on setting up a multiplayer photon unity SteamVR game that tracks controllers would be MUCH appreciated :)

Thanks!

Difference between PUN free and PUN+

$
0
0
Hey Guys

I was thinking of buying PUN+, but i saw that there is also PUN free. What i want to know what are the differences between them? I.e Functionality limitations.

Thanks

"Mirrored" Opponent

$
0
0
I have a problem. My game has specific game field which consists of two parts. For example: top and bottom. On the bottom side located player who directly play from the device, on the top side - his opponent. Bacasue the game is online all player moves must be displayed on the screen, opponents moves must be reflected on the players screen from top side. Game examples: Hearthstone, Clash Royale.

How to connect a player into a different region?

Manual Instantiation example in docs - why is PhotonPlayer sent in RPC?

$
0
0
Hi,

I'm looking the section titled "Manual Instantiation" at the end of this page:

https://doc.photonengine.com/en/pun/current/tutorials/instantiation

In the code (copied below), the PhotonNetwork.player is sent as a parameter to the SpawnOnNetwork RPC function, however it's not used (and not explained in docs).

Could anyone tell me why you would do that? Or what the original intention was in this code?

Thanks


void SpawnPlayerEverywhere()
{
// You must be in a Room already
// Marco Polo tutorial shows how to connect and join room
// See: http://doc.photonengine.com/en/pun/current/tutorials/tutorial-marco-polo

// Manually allocate PhotonViewID
int id1 = PhotonNetwork.AllocateViewID();

PhotonView photonView = this.GetComponent<PhotonView>();
photonView.RPC("SpawnOnNetwork", PhotonTargets.AllBuffered, transform.position, transform.rotation, id1, PhotonNetwork.player);
}

public Transform playerPrefab; //set this in the inspector

[RPC]
void SpawnOnNetwork(Vector3 pos, Quaternion rot, int id1, PhotonPlayer np) //<--- np never used!
{
Transform newPlayer = Instantiate(playerPrefab, pos, rot) as Transform;

// Set player's PhotonView
PhotonView[] nViews = newPlayer.GetComponentsInChildren<PhotonView>();
nViews[0].viewID = id1;
}

Problem with the stream

$
0
0
I have a simple playerHealth script and It was working fine, but when I made a second map it started giving me this error:
InvalidCastException: Cannot cast from source type to destination type.
multiplayer.PlayerHealth.OnPhotonSerializeView (.PhotonStream stream, .PhotonMessageInfo info) (at Assets/Scripts/multiplayer/PlayerHealth.cs:56)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
PlayerHealthScript:

void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
stream.SendNext(health);
}

if (stream.isReading)
{
health = (int)stream.ReceiveNext();
}
}

The error shows up when player gets hit (using RPC call)

Can't manage to fix this, anyone had the same problem?

Error upon importing package.

$
0
0
I just imported the Free package of PUN into my Unity project, but I immediately get these errors:

Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(259,39): error CS0029: Cannot emplicitly convert type 'System.Type' to 'Type'

and

Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(279,27): error CS0029: Cannot emplicitly convert type 'System.Type' to 'Type'

I really want to have multiplayer working in my game, so if anyone could help me, it would be greatly appreciated.

Getting problem with get and set custom properties of room ?

$
0
0
Hi
I am trying to set custom properties of room from reference :
https://doc.photonengine.com/en/realtime/current/reference/matchmaking-and-lobby

the copied code in unity editor :
RoomOptions roomOptions = new RoomOptions();
roomOptions.CustomRoomPropertiesForLobby = { "map", "ai" }; roomOptions.CustomRoomProperties = new Hashtable() { { "map", 1 } };
roomOptions.MaxPlayers = expectedMaxPlayers;
lbClient.OpCreateRoom(roomName, roomOptions, typedLobby);
It gives me error : Unexpected symbol `{'.

I am using unity4.6.1 pro unity version and photon realtime sdk v1.64.2
what is "lbClient.OpCreateRoom". I did not find such a method in sdk or in API.


Want to setup room access(joining) based on player ranking like :
1.Room#1 - Accessible for user who has greater than rank say 100.
2Room#2 - Accessible for user who has grater than rank say 200 .

Thank you.

Check If Room Exists

$
0
0
When we creating a new Room using PhotonNetwork.CreateRoom and give It a name how to check If that Room name Exists or not ???

Ghost competitors in tournament, realtime

$
0
0
Hi,

I know there is a multiplayer platform which specifically sells on the basis that if people enter a room to be matched (1 on 1) and there is no one in the room, the system will match them with a ghost recording from that room's history.

Does photon have this capability? If so, great, if not, is it implemented as a thirdparty add on (??are there thirdy party add ons)? What is the level of effort required to integrate this behaviour into a room

Thanks

jay

My Games (both current and previous Builds) have been stuck on "PeerCreated"

$
0
0
It's been that way for weeks. I've tried re-downloading it and updating the SDK from the unity asset store, but it's still not working.

PUN Problems

$
0
0
Hi, we are developing a game and I think we have hit a wall with PUN.

I am developing a similar game to agar.io / slither.io, we have the game working fine, but yesterday we opened 25 clients to see how it worked and we noticed that we were sending 7000 msg/s when we are only allowed 500msg/s, whooops....

So I guess PUN isnt going to work for us, but will Photon Server be able to do the job for us?

If so, Where would we host our server?

More than anything, this is a hobbyist project and we wouldn't like to spend shit tonnes of money in servers and stuff so any advice would be greatly appreciated.

Also, now that we have realised that PUN isnt for us, do we need the PUN+ that we bought to run the photon servers or would be be able to get the money back for the asset that we cannot use?

Cheers.

Updating across all connected clients

$
0
0
I have an RPG set up and my characters have gear that can be switched in and out(the gear is a child of the main character body) and I want the character's children to be updated across all clients for changes in the gear.

What's the best way to do this? I'm rather new to Photon so I don't know all the possible solutions...

Matchmaking to maintain fixed distribution of players

$
0
0
Hi,

I have used PUN for almost 4 years now. Have 2 live games using it. We are working on a new game which require a bit more complex matchmaking. I will right away go to the problem we are trying to solve.

Our game requires 10 players. We want to match them using PLAYER LEVEL.

Now we want a fixed distribution (not order) of players in a room. Like below
  1. Player 1 - Level 1
  2. Player 2 - Level 1
  3. Player 3 - Level 1
  4. Player 4 - Level 1
  5. Player 5 - Level 2
  6. Player 6 - Level 2
  7. Player 7 - Level 2
  8. Player 8 - Level 2
  9. Player 9 - Level 3
  10. Player 10 - Level 3
I could use sql lobby to specify something like this

C0 >= 1 AND C0 <= 3 // C0 is key for player level

But this will not maintain the distribution. With this room might get all player with level 1 and so on. I could try to change room property when a player joins to change the criteria but by the time room property is changed, player might already join it.

The solution i think could be something like spots in room with weightage which can be changed on player join call. Something like Check and Swap feature.Please let me know if there is a way to solve this problem.

Sorry for long question but it needed to be explained :)

Lots of Crashes on Windows Store

$
0
0
Hello guys i have lots of crashes in windows dashboard. maybe anyone has some thoughts about this

STOWED_EXCEPTION_System.NullReferenceException_80004003_Photon3Unity3D.dll!ExitGames.Client.Photon.SocketUdpNetFxCore.OnConnected

intercommunication between sdks

$
0
0
I have created a session using unity3d sdk of photon from webplayer. And, if I try to get the whole session data using html5-javascript sdk of photon , I am not able to get that data.
In general ,I want the whole session data to be fetched in html5-javascript build when I create the session in unity3d build and vice versa.

Internet connection loss not detected

$
0
0
Hello,

I'm currently using PUN v1.66 (I encounter weird input issues with more recent versions)

In my game if I disable the internet connection the game will not detect it nor call OnDisconnectedFromPhoton, I've waited several minutes without any success, on various platforms (pc/wp/android)

Is there something specific to do in such case? Implement a manual timeout for example?

Regards
Viewing all 8947 articles
Browse latest View live