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

Photon Plugin not receiving some events from the PUN client?

$
0
0
Hello, I'm working on creating an authoritative server using a Photon Plugin. I seem to be able to send out events properly and at a frequency I choose (currently 20 updates per second). However, I'm trying to send inputs from the PUN client at 20 updates per second, but only receiving around 5 updates per second from the client. I've verified (at least using Unity's Debug.Log) that the client is indeed calling PhotonNetwork.RaiseEvent(PhotonConstants.EvCommand, serializedCommand, false, defaultRaiseEventOptions); which does not cache anything and is sent as unreliable. Is there a reason the server might be dropping most of these updates? What's the easiest way to debug the potential cause, and/or what are some potential causes of this?

Any help would be appreciated, thanks!
Curt

Client can connect to master server but cannot connect to game server

$
0
0
So I am running a game where I have set up a computer as a dedicated server. I have it with a static public IP so that never changes and when I connect to it from my house internet it connects fine to the master server and the game server. The problem is that the other person I have testing with me is behind a VPN, we discovered that we couldnt use UPD to connect to the server so we switched to TCP. This allowed him to make a connection to the master server, we know this because we put a bunch of logs that show in the console every step of the connection. So once he reaches the master server he disconnects to find the game server which should be either my computer or his own computer (I used OPJoinOrCreate so it doesnt matter who attempts to be host but we have tried both ways), once the computer disconnects from the master server it never reaches the game server it just times out while trying to connect. Has anyone had this problem and has a solution. Alternatively if anyone knows of where in the LoadBalancing.dll.config file or the LoadBalancing api I should be looking to see if the correct address is being stores/passed along, that would be much appreciated.

Way to get deployment file directory during runtime?

$
0
0
I've tried using Directory.GetCurrentDirectory() but it returns
"D:\...\...\deploy\CounterPublisher" instead of the project. How can I reliably find the deploy directory of the running project during runtime?

Thank you

Unhandled exception handler not called

$
0
0
I'm using the LoadBalancing project (v3.4.31.10808) and I'm trying to register an UnhandledEceptionEventHandler. I want to log unhandled exceptions using a custom log4net appender (SlackAppender).

I know Photon logs unhandled exceptions to PhotonCLR.log, but adding my custom appender to the Photon.local.log4net file but when I did that, nothing logged (presumably because whatever references Photon.local.log4net doesn't have any clue about my appender).

Then, I tried updating the log4net config file (that gets deployed to the LoadBalancing application's directory) to use my appender. The normal logging that config file handles seems to go through, which leads me to believe the issue is not with log4net, but maybe with how I'm trying to capture unhandled exceptions in my code.

I added this line to my MasterApplication#Setup class:

AppDomain.CurrentDomain.UnhandledException += MyExceptionHandler;

That method simply looks like this:
private static void MyExceptionHandler(object sender, UnhandledExceptionEventArgs args)
{
    Exception e = (Exception)args.ExceptionObject;
    log.Info("Unhandled exception logger called...", e);
    log.Error("Unhandled exception occurred in our code...", e);
}
However, when I put a breakpoint inside that method, it's never called even when I explicitly throw an exception in CreatePeer of that same class. Is this somehow related to different app domains and attaching my event to the wrong one?

PluginHost.CreateTimer accuracy/regularity

$
0
0
So in this post. I was running into some issues with PluginHost.CreateTimer(). Ilya mentioned that CreateTimer actually relies on System.Timer, not to mention that the plugin could be running on a heavily loaded host etc. I've found that you cannot rely on the timer firing accurately, and in fact relying on it to figure at accurate and precise intervals is a bad idea. I've seen it vary by as much as 20-50ms from the desired frame time (measured using StopWatch).

All this to ask, is this the expected behavior? It seems then that while writing an authoritative server you cannot rely on this being a regular interval, and should not attempt to set accurate server time messages to the client based on it.

Does that sound about right? Or am I misunderstanding something?

Thanks for any help?

Can not download redistributable license.

$
0
0
I keep getting an error when I try to download the redistributable license.

Error:

Seems like you have been a little bit too quick for us.

Invalid Parameter (the guid of my license is here)
If the problem persists, please contact us.
Try browsing our homepage meanwhile.

Has anyone tried deploying with Docker?

$
0
0
Quick question. Has anyone tried deploying Proton Server to a Docker instance? Seems like a really nice mix of tech for arbitrary amounts of servers to setup and host.
If so, is there a tutorial or image somewhere I can work from? I'm not very familiar with Powershell but I'm sure I'll eventually need to learn it.

https://www.docker.com/

Server side logic advice

$
0
0
I'm woking with Photon Server on premise, and I'd like some advice on the best way to implement and extend the LoadBalancing application.

I have a REST service hosted by a third party that allows me to do authentication and to process shop transactions (to buy some items or to pay before the starting of the match).

But this service doesn't store all the user progress and the list of the owned items. So I also have a DB that I need to update.

So I'm implementing a custom authentication through the REST service, but then I need to load the user progress from my DB.

How do you suggest to proceed? To use Operations and to extend the OnOperationRequest method of HivePeer (not sure is the correct class here, as there is also GameClientPeer and some more).

The player has also to pay before to enter a room and should get refunded if he leaves the room before that the match started.
I was thinking to implement a plugin for this, and use a Synch HttpRequest in the BeforeJoin and OnLeave events (as there is no way to defer those requests). Is it possible? And in the case of failed transaction, I could make the Join action to fail.

A completely different approach could be to create another REST service that acts as a proxy to the 3rd party one and that also updates the DB.
The client will then use WebRPC calls instead of Operations. But in this case, I'm not sure how to guarantee that the user will not join a match without paying the fee. By hacking the client side could be possible to ignore a failed the WebRPC response (or to skip completely the call) and proceed to join the room.

Thank you for any advice you can give me :smile:

Can't start as a service or application in Windows Server 2016 Azure

$
0
0
Hello, I'm trying to test a photon server deploy on a VM in Azure running Windows Server 2016 64b.
I copied the x64 folder with the PhotonControl and when I start the program with Administrator rights it runs and gets visible in the taskbar, but when I select Start LoadBalancing (My Cloud) => Start As aplication, nothing happens, I'was able to test this locally on windows 10 and can run IIS on this server without problem. Any help? thanks!

Cheaters new exploits

$
0
0
So theres been a modder going around in my servers crashing peoples games
I don't know what he does but whenever he "closes" a room you can still see it in the list, but if you try to join you get this exception before right after OnJoinedRoomFail() is called: https://pastebin.com/pe22bEyH
after that you get the OnPhotonJoinedRoomFailed(), OnLeftLobby() and OnDisconnectedFromPhoton() logs.
http://i.imgur.com/aTNAoWj.png

Just what is this?

How to Update the room property after the room created?

$
0
0
I want to Clinet send a request to server,then the Server decide who get which card. and then server Update the room property.
var setPropertiesOperation = new SetPropertiesRequest(peer.Protocol, operationRequest);
setPropertiesOperation.Properties.Add("cards",p.Cards);
setPropertiesOperation.OnStart();
this.HandleSetPropertiesOperation(peer, setPropertiesOperation, sendParameters);
setPropertiesOperation.OnComplete();
I used "SetProperties" ,it doesn't work. Client can't get Properties. Where is my mistake

Moved: A Question About OpRaiseEvent and OnEvent

LoadBalancing: Authentication token is missing

$
0
0
Hey Photon-Com!
What I want to do is refactoring my PUN Cloud Project for a LoadBalancing Edited Server use.
When I start a new downloaded Version of the LoadBalancing files with Photon Control everything works.
But when I rebuild the LoadBalancing Project and copy the files from the src-server\Loadbalancing\LoadBalancing\bin to the deploy/LoadBalancing/GameServer I get an error when I want to create a lobby. (I miss files?)

Operation failed: OperationResponse 230: ReturnCode: 32767 (Authentication token is missing). Parameters: {} Server: GameServer
The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account.

I use custom Auth when I connect to the MasterServer and this still works tho.
What I currently trying is to send a Operation to the Sever and get a Response, but I cant even get the non-edited LoadBalancing Server compiled and working.

Would be awesome if someone can give me a hint,
have a nice day :)

UserId not set

$
0
0
Hello.
I testing connection to photon server.
and Getting an error in Photon Control Log

2017-06-18 00:30:38,454 [7] WARN Photon.Hive.HiveGame - JoinApplyGameStateChanges: Game 'UE-MyWFT-room1' userId '' failed to join. msg:Join failed: UserId is not set, checkUserIdOnJoin=true expects a UserId. -- peer:GameClientPeer: PID 85, IsConnected: True, IsDisposed: False, Last Activity: Operation 226 at UTC 18.06.2017 7:30:38 in Room UE-MyWFT-room1,

in app

MutableRoom& myRoom = mLbc->getCurrentlyJoinedRoom();
const JVector& players = myRoom.getPlayers();
.....

const Player* p = players[i];

result = result + "\r\n " + FString::Printf(TEXT("[ %d ]"), p->getNumber()) + p->getName().UTF8Representation().cstr();





return this:


i.e. userid not set


Moved: UserId not set


problem in running photon server

What is it Server-Plugin-SDKS?

$
0
0
Hello. I was making my game on Photon Cloud but now I think I need authority server. Year ago I already made this server by a good tutorial on Youtube. But it was on Photon 3. Now I see Server-Plugins SDKS. What is it? and need I this or no? I will do all logic only on server(moving, shooting etc).

Moved: (PUN) - Synchronization?

how to stop others people using my photon server?

$
0
0
i installed photon sever in my server, i only need set ip:9090 in my game client, but It's really not safe, if any one know my server ip,they also can use my server for his game client,so how to stop others people using my server?

Write&Read Locks

$
0
0
Some questions. Firstly see this code:

void HelloWorld
{
    using (WriteLock.TryEnter(readWriteLock, 1000))
    {
        SuperFunc()
    }
}
void SuperFunc()
{
//Something...
}
1.I called function SuperFunc() with WriteLock but how can I remove readlock later?
2.What differents between Read and Write Locks and UpgradeableReadLock?
3.When I should use these locks? For example: for reading list but I should use Read Lock right? And If I read&write I use Write Lock?
Viewing all 1557 articles
Browse latest View live