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

Cannot send to: xxx.x.xx.xxx. Not enough buffer space is available

$
0
0
I was trying to search for a solution for this but i'm having issues with running the game on the laptop (this is for IOS though) but still strange its closing the game with this error. Anyone know why it would be doing this?
Cannot send to: xxx.x.xx.xx. Not enough buffer space is available
UnityEngine.Debug:LogError(Object)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1522)
ExitGames.Client.Photon.<>c__DisplayClass145_0:b__0()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:157)

Changing Room Name during session

$
0
0
I'm looking at making a change to allow the host to change the room name.
Firstly is this a good idea, or are there possible issues around doing that?
Secondly, is there an event that gets fired if the room name changes for players in the room?

RemoveFromRoomCache Question

$
0
0
You can open and close doors in my game. Anyone who joins late only cares about the latest "state" of the door (open, closed, etc.). I'm using RaiseEvent for each interaction.

I can accomplish this by raising the event with RemoveFromRoomCache as the caching option and then on the following line raising the same event with AddToRoomCacheGlobal. However, isn't this doubling the amount of network messages I am sending?

Is there a better approach to this issue? Maybe the RemoveFromRoomCache can be run locally once you receive the event, rather than sending another message to everyone telling them to remove it? I would appreciate any help.

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!

PUNBasic tutorial and PhotonView.isMine

$
0
0
The code below confuses me as I feel it should be the other way round?

private void OnTriggerEnter(Collider other) {

if (!photonView.isMine) {
return;
}

if (!other.name.Contains("Beam")) {
return;
}

health -= 0.1f;
}

so if this code runs on player1 should it not be if (photonView.isMine) instead?

If player1 beam is hitting itself then if (photonView.isMine) then return, but if player2 beam is hitting player1 then if (photonView.isMine) would be false and so decrease health?

Mental block ....!!




Scene object rigidbody glitching on remote clients

$
0
0
Hi everyone.

So, I have basically a scene wich contains a black cube. This one has the following components :
  • Rigidbody
  • Photon View
  • Photon Transform View, observed by Photon View
  • Photon Rigidbdy View, observed by Photon View
Look at this short video (1 minute)

https://youtube.com/watch?v=5HTUsSlpXek&feature=youtu.be

On the left side, you have a remote client, on the right side, there is the master client.
As you can see, when a remote client apply a force on the cube, this one cross it before the cube's position and rotation are synced.
This issue doesn't appear on master client.

How can I fix it ?
Thanks you so much :smile:

Area Cull bug? Player Desync

$
0
0
I have an ongoing issue where a player transitioning between grid coordinates on the area cull would just completely desync. The two players testing would be well within range of each other, the whole situation works perfectly until, say, both players shared the same grid, then a player moved to the neighbouring grid, desyncs, even if he re enters the same grid again, sync was broken until the desync player leaves listen range and re enters.

its a relative small scale 3rdp-shooter, i divided the world into about 25 grid, with the goal that the player would only read roughly 25% of the map.
I'm incredibly new to AreaCull, but it seemed very simple attach script and go, did i miss anything??

Setup CullArea
Assign "AreaCullAgents" (forgot the name of the script to attach to player)
Play.

Multiple lobbies

$
0
0
Hi!

I have a problem. I can join to lobbies just fine, but whenever I join to a new one in the LobbyStatistics there are all the lobbies that was ever created. I would like to know if I can delete/make them inactive somehow or it doesnt even matter?

Thanks

Synchronizing Child Animation

$
0
0
Hi,

I have an agent that I want to synchronize using the Transform View and Animator View. The parent/root is the agent and has the Transform View component attached, however: the actual animated agent(s) are children of this root object. Can you advise the best approach to synchronizing the animation for the child?

Do I need to modify the 'Photon Animation View' for this case or is there already a way to handle these kinds of setups?

Any help offered would be much appreciated.

[RESOLVED] PUN Free Import errors and warnings

$
0
0
Hello, today i've tried to use PUN Free (ver: 1.26.1) on my project but when i'm download and import from the unity asset store, photon gives me scripts errors and warnings:

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1608,29): error CS1061: Type `EventData' does not contain a definition for `Code' and no extension method `Code' of type `EventData' could be found (are you missing a using directive or an assembly reference?)

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1834,31): error CS1502: The best overloaded method match for `ExitGames.Client.Photon.IPhotonPeerListener.OnEvent(ExitGames.Client.Photon.EventData)' has some invalid arguments

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(1834,31): error CS1503: Argument `#1' cannot convert `EventData' expression to type `ExitGames.Client.Photon.EventData'

[ERROR] Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs(20,16): error CS0738: `NetworkingPeer' does not implement interface member `ExitGames.Client.Photon.IPhotonPeerListener.OnEvent(ExitGames.Client.Photon.EventData)' and the best implementing candidate `NetworkingPeer.DebugReturn(ExitGames.Client.Photon.DebugLevel, string)' return type `void' does not match interface member return type `void'

[WARN] Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs(142,19): warning CS0436: The type `ConnectionState' conflicts with the imported type `ConnectionState'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/DemoWorker/Scripts/Game/Player/ThirdPersonNetwork.cs(6,5): warning CS0436: The type `ThirdPersonCamera' conflicts with the imported type `ThirdPersonCamera'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/DemoWorker/Scripts/Game/Player/ThirdPersonController.cs(31,12): warning CS0436: The type `CharacterState' conflicts with the imported type `CharacterState'. Ignoring the imported type definition

[WARN] Assets/Photon Unity Networking/Demos/MarcoPolo-Tutorial/Monstergame/Resources/Scripts/myThirdPersonController.cs(2,40): warning CS0436: The type `ThirdPersonController' conflicts with the imported type `ThirdPersonController'. Ignoring the imported type definition

uHb4PGN.png

Because of this errors, i can't setup PUN on my project, please help me :(
In my project i use: Unistorm and Realistic FPS Prefab

(Sorry for my bad english :O)

How to Get Room Properties if all I have is the room name?

$
0
0
I want to return a list of rooms my friends are playing in, but in my lobbies the room name is actually a custom room property, so when I get the list back in OnUpdatedFriendList() I only have access to the string of the room name (which in my case is just a GUID).

I need to access the custom room properties of the room, but all I have is the room name, is there any way to lookup the room details if all I have is the room name?

Android crash on PUN joining room (Unity 2017 + android >= 4.1 ) Helppp needed

$
0
0
Hi,

I am recently upgraded my project to use Unity 2017.1.0f3. Everything works fine except when i try to join or create and join a room. The previous version of Unity 5.6 works, i did update to the latest Photon from AssetStore but the issue remains.

Any urgent help?

Server without port forwarding.

$
0
0
i'm using unity + photon. Is it possible to set up game that any player can create server(max 4 Player) on their pc and any other player can join without port forwarding or connect via program like hamachi (something similar to Left4Death or Payday2)? If is possible, how to set this and if is not, can player create server on something like photon server? How much cost something like that?

JoinRoom create new room

$
0
0
Hi!
I have problem, in my game room can not exist when all users disconnected.
1) I use Photon + PlayFab
2) Game work on mobile (now only Android) and when device was paused I disconnect player
void OnApplicationPause(bool pauseStatus)
{
	if (pauseStatus)
		PhotonNetwork.Disconnect ();
}
3) I create room with second settings:
public void OnPhotonRandomJoinFailed()
{
	PhotonNetwork.CreateRoom(Game.Id, 
		new RoomOptions()
	       { 
			MaxPlayers = 2,
			PublishUserId = true,
			IsVisible = true,
			PlayerTtl = 0,
			EmptyRoomTtl = 0
	      }, null);
}

4) I used next code to reconnect:
protected override void OnScheduledUpdate ()
{
		base.OnScheduledUpdate ();

		if (!PhotonNetwork.connectedAndReady) 
		{
			if(PhotonNetwork.connectionState == ConnectionState.Disconnected )
				PhotonNetwork.Reconnect ();
				
			_reconnectCounter++;
			return;
		}
			
		UnscheduleUpdate ();

		PhotonNetwork.JoinRoom (AppModel.Instance.Game.Id);
}
this function work like update but I can stop it use UnscheduleUpdate() and in AppModel I saved last room id

5) my date from playFab analytics:



when room was created in first time (8:04):
JSON

{
    "EventName": "room_created",
    "EventNamespace": "title.3AE3",
    "EntityType": "title",
    "Source": "3AE3",
    "EventId": "36212b497f0b4ff2af99f25db9790efc",
    "EntityId": "3AE3",
    "SourceType": "GameServer",
    "Timestamp": "2017-09-07T08:04:51.3984748Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "GameId": "cd6db763-e105-42d0-9a05-95299e29cab8",
    "Region": "EU",
    "Type": "Create",
    "UserId": "5D25C0ECF28959E"
}
when room was closed (8:05)
JSON

{
    "EventName": "room_closed",
    "EventNamespace": "title.3AE3",
    "EntityType": "title",
    "Source": "3AE3",
    "EventId": "a1b4270f1d0849d09cccfab54f8eae4c",
    "EntityId": "3AE3",
    "SourceType": "GameServer",
    "Timestamp": "2017-09-07T08:05:15.2271116Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "GameId": "cd6db763-e105-42d0-9a05-95299e29cab8",
    "Region": "EU",
    "Type": "Close"
}
when room was create in second time (8:05)
JSON

{
    "EventName": "room_created",
    "EventNamespace": "title.3AE3",
    "EntityType": "title",
    "Source": "3AE3",
    "EventId": "f06695d7fe3c4e5c9a7b16c05cca9da0",
    "EntityId": "3AE3",
    "SourceType": "GameServer",
    "Timestamp": "2017-09-07T08:05:25.7890347Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "GameId": "cd6db763-e105-42d0-9a05-95299e29cab8",
    "Region": "EU",
    "Type": "Load",
    "UserId": "5D25C0ECF28959E"
}

NCommand.CreateAck excaption

$
0
0
Occasionally, our players would report an network issue and the following call stack would appear in the output_log.txt.

System.IndexOutOfRangeException: Array index is out of range.
at ExitGames.Client.Photon.NCommand.CreateAck (System.Byte[] buffer, Int32 offset, ExitGames.Client.Photon.NCommand commandToAck, Int32 sentTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.QueueOutgoingAcknowledgement (ExitGames.Client.Photon.NCommand readCommand, Int32 sendTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.ReceiveIncomingCommands (System.Byte[] inBuff, Int32 dataLength) [0x00000] in :0
at ExitGames.Client.Photon.NCommand.CreateAck (System.Byte[] buffer, Int32 offset, ExitGames.Client.Photon.NCommand commandToAck, Int32 sentTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.QueueOutgoingAcknowledgement (ExitGames.Client.Photon.NCommand readCommand, Int32 sendTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.ReceiveIncomingCommands (System.Byte[] inBuff, Int32 dataLength) [0x00000] in :0
Exception while reading commands from incoming data: System.IndexOutOfRangeException: Array index is out of range.
at ExitGames.Client.Photon.NCommand.CreateAck (System.Byte[] buffer, Int32 offset, ExitGames.Client.Photon.NCommand commandToAck, Int32 sentTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.QueueOutgoingAcknowledgement (ExitGames.Client.Photon.NCommand readCommand, Int32 sendTime) [0x00000] in :0
at ExitGames.Client.Photon.EnetPeer.ReceiveIncomingCommands (System.Byte[] inBuff, Int32 dataLength) [0x00000] in :0

Spawn / Sync existing game object (Player)?

$
0
0
Hello,

My current game is using vrtk (VR ToolKit). I have this CameraRig game object, which is the player character. For some reasons, this CameraRig need to be on scene first instead of using PhotonNetwork.Instantiate function to spawn it. I cant get this CameraRig sync across the network.

What I've tried so far:
Attempt1: I have added photon view and network object component to the CameraRig. And set the CameraRig game object as the observed component in photon view component. Result: Player1 cant see Player2 (and vice versa)

Attempt2: I created another player prefab, when joined room. I use PhotonNetwork.Instantiate to spawn the player prefab.
void OnJoinedRoom() {
	if (PhotonNetwork.isMasterClient)  NewPlayer (0);
}

[PunRPC]
void NewPlayer(int idx) {
	var trans = cameraRig.transform;
	var player = PhotonNetwork.Instantiate (playerAvatar.name, trans.position, trans.rotation, 0);
	player.name = "Player " + (idx + 1);
}
Now Player1 and Player2 can see each others. Then, in my Player prefab have this player setup script.
void Awake () {
        if (!photonView.isMine) {
            return;
        }
	GameObject g = GameObject.FindGameObjectWithTag("CameraRig");
        g.transform.parent = transform;
}
I grab the CameraRig game object and set it as a child of the new player prefab thats instantiated by using PhotonNetwork.Instantiaite function. As expected, the CameraRig and its children game objects' position and rotation do not sync.

Given my current scenario above, how should I spawn / sync the players(CameraRig) game object ?
(Again, i need to emphasize this, the CameraRig game object needs to be on scene before the game connect to Photon server)

My CameraRig game object structure is something like this:
CameraRig
-- Ragdoll
-- Left Hand Controller
-- Right Hand Controller
-- Camera (head)
-- etc

Please advise. Thanks.

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 need to use a recent 4.x server.

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 or newer.

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 networkcode versus their own test procedures.

Explicitly point to their own test-description page.

Apple suggests:
If the iOS application is successful in working across the macOS NAT64 test environment, then the next step is to submit a bug report. We ask developers to use the Apple Developer Bug Report web page - http://bugreport.apple.com to submit the bug report. The bug report is to indicate that there is some compatibility issue between the app and the App Review test environment. In the bug report, the developer provides evidence that the iOS application worked successfully across the macOS NAT64 test environment by including a packet trace to show the success of the connection process.

Note that the bug report is not an indication as to where the problem lies, but the fact that the iOS app works in the test environment and not in App Review is an indication that the app / App Review interaction needs further review. Once the bug report is submitted, there issue is then assigned to investigation by an App Review group. Once a bug report is assigned to App Review, the next thing is to follow up with the bug report by communication with App Review - “appreview@apple.com”. While the email inquiries may not always get a response - all of the correspondence is viewed.

Cloud and Server

The Photon Cloud can not provide public IPv6 addresses in the short term. However, Apple's requirement is only that clients can cope with IPv6 addresses in their network, if that provides "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.

Why photon unity network cannot connect with wifi connection?

$
0
0
Hai guys anyone know why PUN cannot connect using wifi, and how to fix it?? Thanks

PhotonNetwork.JoinRoom problem

$
0
0
Hi,

I've got problem with JoinRoom(name) function.

I want to join room by name when someone else created private room and share room name.

It's working fine but I've got weird problem.

When I try to join room by name and this room doesn't exist then I expected I should receive message that room doesn't exist and I cannot join it but instead this room is created. I thought it should work like that in JoinOrCreate rather than in JoinRoom.

Can anyone help me?

Dropping and Picking up issue

$
0
0
Hello there !

I'm having little issue with Networking (Syncing) Weapon pickup and drop, What have done is that i made the drop and pickup succesfully but it doesn't really work for newly joined players,
What i've tried to do i made some RPCs with Buffer but that would be bit buggy for ex (player keeps picking up and other droping it), i tried also custom properties to player saving weapon viewId's to player custom properties but i couldn't finish that cause can't tell which player owns the weapon when player connects (getting photonView)
i tried alot of things but didn't get to what i wanted to make
Does anyone have an ideal setup to make droping and picking up synced even for newly joined players?

Thanks !
Viewing all 8947 articles
Browse latest View live


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