Quantcast
Channel: Photon Server — Photon Engine
Viewing all 1557 articles
Browse latest View live

How intercept RPC and save game data in server?

$
0
0
Hi all,

First all, sorry for my english, I am spanish native :disappointed:

We had a game in Photon Cloud but for a specific game logic we need a server side logic. Then we are testing the Photon Server, all work perfectly with the LoadBalancing application, but we have some questions.

Our game is a ball game based, then we need to save some variables like the last team with possesion. When a player get the ball, he send a PunRPC to the remote player.

Then we need that the server intercepts that RPC and it check first if the last team possesion is diferent. If it is different it will let the RPC continue else the server will block the RPC and will send a reponse to the source (local player) with a error code.

We are trying to debug the server, and we have checked the OnOperationRequest method in GameClientPeer.cs, but the PunRPC dont use this method.

Must we change all the RPC to operations? In which script we must save the variables and data for every game? Maybe in Game.cs?

Thanks for your time, kind regards!



Game works using Photon Cloud.. Crashes when self hosted

$
0
0
So I am hosting a game on a LAN and not using the Photon Cloud and when I try to use the self hosted server (LoadBalancing), my game will crash at random times, even when I am just sitting there and watching it (not giving any input commands). And there are some times when it doesn't crash at all. But when I played the game on the Photon Cloud instead, there were never any crashes. Has anyone run into this sort of problem before? I'm not sure what I am doing wrong with my self-hosted server, I set it up exactly as the 5-minute setup guide said on my Windows 10 Desktop.

LAN connect correct but WAN not

$
0
0
Hi All
I created a Photon Server in my office room. In LAN work is OK, but WAN is not.
Firework is not setup. and outside Port already opened
It still can't connect~~
any can help me to fixed it.

(Photon Server version: Photon-OnPremise-Server-SDK_v4-0-29-11263)

Can't get SDK TestClient to work

$
0
0
When i run the SDK TestClient i recieve the following message in the prompt:

Starting 5 games with 3 players
[11696] Press Return to End
Connecting to 192.168.1.2:5056
[11696] Started game KURO(11696)1 with 3 clients
Connecting to 192.168.1.2:5056
OnOperationReturn: JoinGame failed: ReturnCode: 32758 (Game does not exists). Disconnecting...

All that i did was:

Donwload the SDK Photon-OnPremise-Server-SDK_v4-0-29-11263.
Set up the license.
Start the SDK.
Set server IP as local
Start LoadBalancing server.
Run TestClient

About Photon Counter

$
0
0
Hello.
I'd like to confirm the item of the ApplicationBase(for example," {ApplicationName}. MessagesSentCount") in the Photon.SocketServer.Diagnostics.PhotonCounter follower by a performance monitor.
I installed PhotonCounter, but that is'nt output.
How should I do?

MyCloud & PhotonCloud

$
0
0
Hello!

Your PhotonEngine is awesome! In compare to UNet. Thank you very much! And big thanks for PhotonCloud! It works good, but I have problem with latency.

I live and work in Khabarovsk (Russia). Khabarovsk is near China. But PhotonCloud gives best region for me is EU (Amsterdam). So, ping is 170-180 ms. I develop snake-like online game, and this latency for me is not acceptable.

I deployed a server and installed PhotonServer. So, ping is 8-10 ms. This latency is ok!

But there are many (not so many :-( ) people play in USA and Europe. And I want that these people could use PhotonCloud (if the latency PhotonCloud would be better than MyCloud).

What is the best way to realize this algorithm?

P.S.: Sorry for my bad English!

PhotonServer load-balancing setup (was Redistributable server SDK available in a 64 bit version?)

$
0
0
I am in the mist of setting up multiple servers to support a larger amount of users than a single server can hold. I am assuming that it is not possible to use the regular server sdk for that, yes? And if not, is it then possible to get my hands on a 64 bit version of the redistributable server sdk?

OnOperationRequest send message to a client for UserID

$
0
0
Hola miembros del foro !!

Hemos puesto en marcha una operación personalizada en nuestro servidor y administrarlo en el servidor con el evento OnOperationRequest. Usamos la Aplicación LoadBalacinng en el servidor de Fotones.

¿Cómo podemos enviar un Info a otro cliente utilizando el ID de usuario?

Buscamos en la clase GameClientPeer los métodos:

Enviar datos
SendEvent
Enviar mensaje
SendOperationResponse

Y parece que envía la información al cliente de origen.

Tal vez debemos crear una instancia de un nuevo GameClientPeer y llamar a la SetupPeer antes de llamar a un método de envío?

Gracias por su tiempo, Saludos cordiales !!

Photon Server Process Crash

Photon Server IPV6 issue

$
0
0
HI,I use Photon Server 4-0-29-11263,According to the IPV6 configuration,I set:

IPAddress="0.0.0.0"
IPAddressIPv6="::"
Port="5055"

But when i change network to ipv6, i cannot connect the server. If I miss other configuration?

Unable to use Azure SDK

$
0
0
Attempting to use the "Upload: Azure Lite" option in the build prompter gives me the errors outlined in this Upload.log file

I am under extreme time constraints and would appreciate it if I could get some assistance with this issue, thank you.

How to get PhotonNetwork.ServerTimestamp in Photon Plugin?

$
0
0
How to get PhotonNetwork.ServerTimestamp in Photon Plugin?
I couldn't find from a reference.

Photon server and IPv6

$
0
0
My update build was rejected by Apple today because the reviewer can't connect to the server and it seems it's because my game / server does not support IPv6. I read the forum and it seems the newer version of Photon server / PUN+ support IPv6. My question is do I have to update the server or do I have to update the client (I'm using PUN+ v.1.51 and the LoadBalancing server as base). If possible I want to update the least number of file the possible because I heavily modified some of the Photon code (like the networkingpeer.cs in PUN+ for example).

A question unrelated to Photon: how can setup an IPv6 environment so I can test it like the guy at Apple does?

Weird instant ClientDisconnect

$
0
0
Heya,

I have set up Photon Swarm with a UE4 project and locally, everything works fine. However, when I try to connect remotely, it connects to the master server just fine... but when I try to create a room, this happens on the server side:
2016-11-03 16:31:33,826 [10] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - Created game: gameId=Test Room, appId={Default}
2016-11-03 16:31:33,830 [10] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameListBase - PlayerCount updated:newValue=1, oldPlayerCount=0, plyaerCount=1
2016-11-03 16:31:33,831 [10] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState - Added peer: gameId=Test Room, userId=ee30590c-dd6d-4571-8e4f-7cf71922091e, joiningPeers=1
2016-11-03 16:31:33,831 [13] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache - Player state changed: pid=ee30590c-dd6d-4571-8e4f-7cf71922091e, master=True, gid=Test Room
2016-11-03 16:31:33,833 [10] DEBUG OperationData - SentOpResponse: Peer=T:MasterClientPeer,ConnId:0,ip:185.6.104.142:62745, opCode=227, return=0, ChannelId=0, result=Ok, data=(53 bytes) F3-03-E3-00-00-2A-00-02-E6-73-00-14-31-34-36-2E-32-35-35-2E-31-35-38-2E-31-39-34-3A-35-30-35-36-FF-73-00-11-48-69-67-68-6C-61-6E-64-65-72-27-73-20-52-6F-6F-6D
2016-11-03 16:31:33,881 [16] DEBUG Photon.SocketServer.ApplicationBase - OnDisconnect - ConnID=0 reasonCode=ClientDisconnect
2016-11-03 16:31:33,882 [14] DEBUG Photon.SocketServer.PeerBase - Connection state changed from Connected to Disconnected: peer=T:MasterClientPeer,ConnId:0,ip:185.6.104.142:0
2016-11-03 16:31:33,882 [14] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer - Disconnect: pid=0: reason=ClientDisconnect, detail=
2016-11-03 16:31:33,883 [14] DEBUG Photon.LoadBalancing.MasterServer.GameApplication - OnClientDisconnect: peerId=0, appId={Default}
2016-11-03 16:31:33,883 [11] DEBUG Photon.LoadBalancing.MasterServer.Lobby.AppLobby - peer removed from lobby:l:'Photon.LoadBalancing.MasterServer.Lobby.AppLobby',p:'T:MasterClientPeer,ConnId:0,ip:185.6.104.142:0',u:'ee30590c-dd6d-4571-8e4f-7cf71922091e'
2016-11-03 16:31:33,884 [14] DEBUG Photon.SocketServer.PeerBase - Connection state changed from Disconnected to Disposed: peer=T:MasterClientPeer,ConnId:0,ip:185.6.104.142:0
The client receives a 1040 error a while later, but nothing else in between:
PhotonLBC:  2016-11-03 16:31:30,790 INFO    Client.cpp                     ExitGames::LoadBalancing::Client::onOperationResponse()      line:   668 - OperationResponse - operationCode: 227, returnCode: 0
PhotonLBC: 2016-11-03 16:31:30,823 INFO PeerBase.cpp ExitGames::Photon::Internal::PeerBase::connect() line: 171 - address: 146.255.158.194:5056
PhotonLBC: 2016-11-03 16:31:40,923 INFO EnetPeer.cpp ExitGames::Photon::Internal::EnetPeer::sendOutgoingCommands() line: 172 - disconnect due to retry timeout (max retry time) time: 10109 originalSentTime: 63
PhotonLBC:Error: connection failed with error 1040
PhotonLBC: disconnected
Any help on this matter (or at least how to debug it) would be appreciated. All the ports are forwarded on the host machine, firewalls were turned off on both for good measure as well.

Best regards,
Damir H.

How to choose which plugin to use when creating a room in ue4?

$
0
0
In ue4 sdk, there is nothing like:
roomOptions.Plugins = new string[] { "NameOfYourPlugin" };

Keep connected to the Lobby in MasterServer while the client connect to the GameServer

$
0
0
Hi people!!

We have a simple question. In LoadBalancing appication, if a client connect to the GameServer (Join a room) they lost the connection with the master server. This is the basic behavior and we understand it.

But, we need that the clients keep connected to the Master Server for send some information. Players in the lobby need send information to clients in the rooms. For example, a chat message. In our project this works when both players stay in the Lobby, but when a client connect to a room, the players in the lobby cant sent information.

We are thinking in modify the PUN plugin for add a auxiliar connection to the Master Server. Is there any simple way to do this? Are we in the correct way?

Thanks for your time, kind regards!!



Public IP/Photon Cloud not working

$
0
0
Hi everyone,

I might a bit of a newbie to the whole thing so please bear with me if I'm not making much sense.

I've created a turn-based MP game in Unity using PUN & Photon Server. I tested most features with Photon Server set to Local IP and everything works just fine.

Unfortunately, now I'd like to test everything on a device or on different PCs and I don't seem to be able to make it work.

If I select Photon Cloud (from Unity), I get the following message: TimeoutDisconnect while connecting to: ns.exitgames.com:5058. Check if the server is available.

If I choose self hosted and I choose "Public IP" from Photon Server it doesn't work - so I did a client test and saw that I receive a sort of error: OnOperationReturn: JoinGame failed: Return Code 32758 (Game does not exist). Disconnecting...

Not sure if I missed something.

Any help would be much appreciated.

Thanks!

Rebuilt Loadbalancing source code not working

$
0
0
Hello everyone,

I've recently started the adventure of creating my self-hosted photon server with my own authoritative logic. I've learned already a lot but I still have lot to learn.

I was starting implementing my own server plugin and so edit and add code on my "copy" of the loadbalancing source code found with the photon server download and something strange happens: the server runs, photon too and even the unit test's connection works, but when I try to connect with the vikings demo it just stop working (the error is that after trying to connect, the value inside PhotonNetwork.playerName become null, and I think also all the rest). On Server side, there's no errors and no traces of connections on all logs.

It's not caused by my custom code since I've also tried to rebuild the same untouched source code found in the downloaded archive.

The fun thing is that if I use the already compiled loadbalancing dll's found within the package, everything works.

So my question is: what's wrong? Where I'm missing something? It is normal or do I have some kind of issues with my visual studio/.Net installation?

My procedure to test the new loadbalancing is:

- rebuild all the solution
- copy all the content of ...Photon-OnPremise-Server-SDK_v4-0-29-11263\src-server\Loadbalancing\LoadBalancing\bin
- paste files in ...deploy\Loadbalancing\Master\bin and deploy\Loadbalancing\GameServer\bin
- re-run photon server (even if I've noticed it will automatically reload the server once you change the files).

Any help would be enormously appreciated.

Thank you!

Z

Can Not Connect to server

$
0
0
I am new to photon and unity and i am following some1's tutorial on how to setup the photon cloud and to create a lobby.

The code work for him yet mine can not connect and i get the followin messages in the console:

SwitchToProtocol: Udp PhotonNetwork.connected: False
UnityEngine.Debug:Log(Object)
PhotonNetwork:SwitchToProtocol(ConnectionProtocol) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1170)
PhotonNetwork:ConnectUsingSettings(String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1217)
GameManagerScript:Connect() (at Assets/Scripts/GameManagerScript.cs:11)
GameManagerScript:OnGUI() (at Assets/Scripts/GameManagerScript.cs:49)

Operation failed: OperationResponse 225: ReturnCode: 32760 (No match found). Parameters: {}
UnityEngine.Debug:LogWarning(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1528)
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)

I have checked the code and settings a millions times, the setup of everything ive done and redone many times yet still nothing happens.

This is my code, help me out please...

using UnityEngine;
using System.Collections;

public class GameManagerScript : Photon.MonoBehaviour {

public GameObject[] SpawnRed;

public int state = 0;

void Connect() {
PhotonNetwork.ConnectUsingSettings ("v 1.0"); //connect to server

}

void OnJoinedLobby() {
state = 1;
}//end of loby joined


void OnPhotonRandomJoinFailed() {
//Debug.Log("Failed to connect");
PhotonNetwork.CreateRoom(null);

}

void OnJoinedRoom() {
state = 2;
}//end of joined room

// Use this for initialization
void Start () {

}//end of start

// Update is called once per frame
void Update () {

}//end of update

void OnGUI() {

switch (state)
{
case 0:
//starting screen
if (GUI.Button(new Rect(10, 10, 100, 30), "Connect"))
{
Connect();

}//end of if

break;

case 1:
//connect to server
GUI.Label(new Rect(10, 10, 100, 30), "Connected");

if (GUI.Button(new Rect(10, 10, 100, 30), "Search")) {
PhotonNetwork.JoinRandomRoom();
}//end of search if
break;
case 2:
//Champion select
GUI.Label(new Rect(10, 40, 200, 30), "Select Your CHampion");
if (GUI.Button(new Rect(70, 10, 100, 30), "Tim")) {
Spawn(0, "Tim");

}//end of time function

break;
case 3:
//In Game

break;


}//end switch stsate

}//end of onGUI

void Spawn(int team, string character) {
state = 3;
Debug.Log("You are on Team... " + team + "and are playing as " + character);
}//end of spawn function


}//end of program

Unity RPS demo not working with LoadBalancing Server

$
0
0
I'm setting a new Photon server for a new game and decided to start fresh new Photon server v4 and run the Unity demo with it to test and I got error when I was running the RockPaperScissors demo. The server didn't return userId after the client connected to server and when I tried to join the room via joinrandomroom this error pop up:
Operation failed: OperationResponse 226: ReturnCode: -2 (Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId.). Parameters: {} Server: GameServer
Is there any way to fix this. does LoadBalancing not build to run this demo? Note that I can run the demo with PhotonCloud easily.

Both PUN+ and PhotonServer are latest version.
Viewing all 1557 articles
Browse latest View live