Hey,
What is a minimum spec of Android os for multiplayer?
Thanks in advance.
↧
Minimum Android specs requirements
↧
How to get the time lapsed without server communication.
Hi
Is there any way to get the time lapsed since the client's last successful ping/communication with photon server? (whatever you use to detect StatusCode.TimeoutDisconnect, the client timeout disconnect).
I'm implementing a way of detecting inactive characters, but I get false positives when I'm the one who loses the connection but I haven't yet received the connection fail event, since I can't receive data from other players. Basically I want to players who have been inactive less time that the time lapsed since the last successful ping.
Thanks.
↧
↧
How do I immediately detect a local disconnection (before timeout is triggered)?
Hello,
I'm looking for a way to immediately detect when the local client's network connection has been lost. I would like to start handling the scenario before the timeout kicks in. It seems to be that there should be a way to do this but I can't find where this information can be gleaned.
Here's an example. I'm testing with 2 machines. They both connect and join a room. On machine A I quickly toggle the WiFi connection on and off, the connection is lost for less than a second. I wait. After about 10 seconds machine B is told by the server that the other player has disconnected. About 5 seconds after that machine A indicates that it's been disconnected.
I'd like to reconnect machine A right after the WiFi is toggled but I don't know how to detect that in Photon. It seems as though Photon has detected it because it starts a timeout counter. Is there a local event for this or some variable that keeps track of the last time a message was received or something?
Please let me know. Thanks.
↧
Staying in the same room
Im using the basic photon 2 demo pun basics room for 1
Id like all the players to be in the room for 1 instead of going into bigger rooms if more players enter.
What is the optimal way to change the code so that no matter how many players enter they stay in room for 1?
↧
only main can see other player
Only the game host can see the other player. The movements are also synced together. Any clue what this could be?
↧
↧
connecting after calling disconnecting
i tried to connect to photon at the samew time im calling disconnecting and coming back at that time my application is connecting on background.how to stop that.
↧
Are player custom properties deleted on room left?
The doc says:
Custom Properties
In Photon, you can set Custom Properties for Rooms and Players. In both cases, the custom properties are provided as Hashtable and the key must be of type String but can have any (serializable) value.
Custom Properties are deleted when players abandon a game. Turnbased "async" games will persist them.
So the question is: do game in this context means room or game server?
↧
Can Different Versions of PUN play together
my live game is version 1.91 but pun on the store is 1.92.
Can these two versions play together?
if not, where can i find the 1.91 version of PUN.
Thanks
↧
Port settings for Unity 2018 game running in Photon cloud
Hi all,
I wanted to show a friend a game I'd made with Unity that runs on Photon PUN cloud today behind the firewall of his corporate network. While doing this via his office wifi was no problem connecting to the Master Server failed via his LAN. This got me to wondering about the feasibility of distributing my game to people working in various well-defended network environments and not just from home or the local Starbucks. Question: can someone tell me exactly what ports must be opened to get a game running in the Photon cloud to work and not make me feel silly when I go to demo my "masterpiece" to people?
I wanted to show a friend a game I'd made with Unity that runs on Photon PUN cloud today behind the firewall of his corporate network. While doing this via his office wifi was no problem connecting to the Master Server failed via his LAN. This got me to wondering about the feasibility of distributing my game to people working in various well-defended network environments and not just from home or the local Starbucks. Question: can someone tell me exactly what ports must be opened to get a game running in the Photon cloud to work and not make me feel silly when I go to demo my "masterpiece" to people?
↧
↧
Issues when trying to teleport multiple players to different positions in PUN V1
I'm making a game where players are put onto plates and random events happen to the plates/players. I've gone through a multitude of different networking solutions like UNET, Mirror, Mirror+Steamworks P2P but none of them really worked well (main issue being not being able to join via IP) so I settled on Photon. After Punv2 just wouldn't work on my project (an error in PhotonEditor.CS) I just used Punv1 which is working perfectly for the most part.
The issue right now is that I'm trying to spawn players on their owned plates but they only spawn on the first plate despite each plate being owned by a player (each plate has a script that specifies which player 'owns' it. This is being set correctly). This only seems to happen when I try to test with a real player/client. If I create a fake player by just spawning in the prefab and then running it, both players will be moved to their correct plate so it seems to be a networking issue.
Here's the code responsible for moving the players to their plates.
foreach (GameObject plate in spawnedPlates)
{
//Here we loop through each plate, get the player assigned to it and move the player to that plate.
GameObject player = plate.GetComponent().assignedTo;
PlayerClientControl playerController = player.GetComponent(); // originally for UNET/Mirror. Left in incase I need it(had an RPC function that moved the player).
player.transform.position = plate.transform.position + new Vector3(0, 4, 0);
}
It seems they ARE being moved to the correct positions (or atleast, it's trying to move them to the correct position) via a debug print statement that prints where they are trying to be teleported to further cementing that this is a networking issue but I have no idea how to fix it.
I assume it's something to with host/client synchronization? If anyone could shed some light on this, that'd be great because I'm pulling my hair out over this.
What am I doing wrong?
↧
Set custom Properties of a room
Hallo. Merry christmas to all :)
I want to set a room propertie with the code:
void Awake()
{
Hashtable setValue = new Hashtable();
setValue.Add("val", turn);
PhotonNetwork.room.SetCustomProperties(setValue);
}
But unfortunately the error occurs: " PhotonNetwork does not contain a definition for ´room´ "
Thanks for any help guys.
↧
Unity 2019 Beta: Prefabs with Photon View components are breaking
Hello,
I was just wondering if anyone else has tried pairing PUN 2 with the Unity 2019 beta. I seem to be having issues with the prefabs that I save for instantiation inside of my resources folders being broken (only occasionally, and only prefabs with the photon view component).
Unity doesn't allow them to be dragged into the scene and causes a whole host of problems that I'm afraid I don't really understand.
I would be happy to post more specific error messages if it would be helpful.
Thanks!
↧
Warning: "Duplicate Shortcut Identifier found: Component/Photon Networking/Photon View. Ignoring"
I'm getting many of these warnings after upgrading to Unity 2018.3:
Duplicate Shortcut Identifier found: Component/Photon Networking/Photon View. Ignoring
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()
PUN v1.92
↧
↧
About disconnection on mobile
We are using PUN 2 currently and everything else is fine except for one problem.
On PC, when player loses connection, we receive "OnDisconnected" ;However, on mobile device (such as fly mode or disconnecting wifi), we do not receive anything. Is there a way to detect disconnection from mobile device?
↧
Access to a specific player's variable
Hi friends, I am developing a game using photonnetwork,
I want to do this, I want to write a text ("Target accepted") to a specific player's text variable using RPC.
I've written a code as follows, but it doesn't write anything in the text variable.Interestingly The unity editor debug console also writes "Target accepted".
Do you think what is wrong, or is there a method you can suggest?
public void OwnerKabul()
{
view.RPC("TargetAcceptRpc", PhotonTargets.AllViaServer, sender.gameObject.GetPhotonView().viewID, target.gameObject.GetPhotonView().viewID);
}
[PunRPC]
void TargetAcceptRpc(int senderView, int targetView)
{
sender = PhotonView.Find(senderView).transform;
target = PhotonView.Find(targetView).transform;
sender.GetComponent().isOwner = true;
target.GetComponent().isOwner = true;
if(view.isMine)
{
targetUserName.text = target.GetComponent().owner.NickName;
}
else
{
targetUserName.text = sender.GetComponent().owner.NickName;
}
target.GetComponent().targetAcceptText.text = "Target accepted";
Debug.Log("Look here " + target.GetComponent().targetAcceptText.text);
//canvas.gameObject.SetActive(false);
}
↧
Cannot join existing rooms (PUN2)
Hi everyone,
Whenever I create a room another player cannot join it. I have overrided the function OnJoinRoomFailed to Debug an error if the room cannot be joined.
Lets say on one client I create a room called "TEST", on a different client if I do PhotonNetwork.JoinRoom("TEST") it will give me an error and call OnJoinRoomFailed. Also, my server browser is no longer working all of a sudden. I was working on my project last night at around midnight and woke up to find that I cannot join any rooms and my server browser is not working.
Is this a Photon issue?
Thanks!
↧
WebRPC Response
Im trying to connect to my server with webrpc and get a response back but i cant catch any response.
Here is my php code, the json sent back should be okay.
<?php
header('Content-Type: application/json');
$request = file_get_contents('php://input');
$decoded = json_decode($request);
$array = null;
if($decoded === null) {
$req_dump = print_r( "Failed to decode the JSON Object\n", true );
$fp = file_put_contents('/var/log/gameserv/log2.log', $req_dump,FILE_APPEND );
}
$array = array(
"ResultCode" => 0,
"Message" => "Found post!"
);
$out = json_encode($array);
echo $out;
?>
Then in unity:
public void OnWebRpcResponse (OperationResponse operationResponse) {
Debug.Log ("RECEIVING SOMETHING!");
if (operationResponse.ReturnCode != 0) {
Debug.Log ("WebRPC operation failed: " + operationResponse.ToStringFull ());
return;
}
WebRpcResponse webRpcResponse = new WebRpcResponse (operationResponse);
if (webRpcResponse.ReturnCode != 0) {
Debug.Log ("WebRPC " + webRpcResponse.DebugMessage);
return;
}
Dictionary parameters = webRpcResponse.Parameters;
foreach (KeyValuePair pair in parameters) {
Debug.Log(string.Format("KEY {0} / VALUE: {1}", pair.Key, pair.Value));
}
}
Not sure why im not getting any result back. Server side i can see the webrpc and parameters sent and can decode the object no problem. But cant get anything from it. I tryed with Postman and it was working well, im getting the resultcode 0 and found post! message.
Any idea?
↧
↧
Is PUN unreliable for real time multiplayer games?
Let's say player A shoots a weapon and detects a hit on player B on one client. But on the other client, the collision wasn't detected because one player was on a slower connection than another and all the positions didn't update. Then how do you know whether to say there was a hit or not? If you have a dedicated server, then you would use that as the single source of truth, but it doesn't seem possible on PUN, but there must be a solution or nobody would use photon. Does anyone know how to solve this problem?
↧
WebRPC Response
Hello!
I'm sending a webrpc to my web server which have a php script setup to handle it this way:
<?php
header('Content-Type: application/json');
$request = file_get_contents('php://input');
$decoded = json_decode($request);
$array = null;
if($decoded === null) {
$req_dump = print_r( "Failed to decode the JSON Object\n", true );
$fp = file_put_contents('/var/log/gameserv/log2.log', $req_dump,FILE_APPEND );
}
$array = array(
"ResultCode" => 0,
"Message" => "Found post!"
);
$out = json_encode($array);
echo $out;
$req_dump = print_r( $request, true );
$fp = file_put_contents('/var/log/gameserv/log.log', $req_dump,FILE_APPEND );
$req_dump = print_r( $out, true );
$fp = file_put_contents('/var/log/gameserv/log2.log', $req_dump,FILE_APPEND );
?>
On my unity client, i have this setup:
public void createCharacter() {
Dictionary _test = new Dictionary();
_test.Add ("UserId", 1);
_test.Add ("eyebrow", 1);
_test.Add ("ear", 1);
Debug.Log ("test " + _test);
PhotonNetwork.WebRpc ("webrpc.php?webhook=1", _test);
PhotonNetworkingMessage.OnWebRpcResponse;
}
void OnWebRpcResponse (OperationResponse operationResponse) {
Debug.Log ("RECEIVING SOMETHING!");
if (operationResponse.ReturnCode != 0) {
Debug.Log ("WebRPC operation failed: " + operationResponse.ToStringFull ());
return;
}
WebRpcResponse webRpcResponse = new WebRpcResponse (operationResponse);
if (webRpcResponse.ReturnCode != 0) {
Debug.Log ("WebRPC " + webRpcResponse.DebugMessage);
return;
}
Dictionary parameters = webRpcResponse.Parameters;
foreach (KeyValuePair pair in parameters) {
Debug.Log(string.Format("KEY {0} / VALUE: {1}", pair.Key, pair.Value));
}
}
Im connecting with customauth to my server and can get an anwser back and all i can see the data trought the echo of login but i cannot get any anwser back from the webrpc. On server side i see i receive the _test object im sending and all just cant get any anser back. Tryed with Postman and everything is fine. So im guessing my void onWebRpcResponse is not correct but cannot find any documentation that clearly show how this work. I'm using Pun v2.
Anyone could help me figure out? :)
↧
How to set secure send with authcookie on client
Hello again!
I'm using Pun v2 and webrpc and i want to send secure auth cookie which i set from server on login when i return my data to client. I'm not sure how to set it client side. When i check the data i get from the server i just see the usual userid, appid, version, etc no sign of the authcookie so i guess its not being send automatic if you set it.
I searched trought forum and saw JohnTube saying you could modify some file and make it happen but since that post is old and im using pun v2 im not sure this is appropriate for me.
Anyone know how?
↧