Migrating to photon cloud.
i have completed an app in ios(with demo_iPhone_realtime_objc as code base) with a local photon server instance.Now I am planning to move to photon cloud. Can you suggest me way to do it ?
I have already tried with load balancing app (your demo code) and can able to successfully connect to photon cloud. But i dont how to migrate the existing app which run successfully in local photon server instance to photon cloud.
I have already tried with load balancing app (your demo code) and can able to successfully connect to photon cloud. But i dont how to migrate the existing app which run successfully in local photon server instance to photon cloud.
0
Comments
-
First of all: Photon Cloud does not allow customer server code. It runs the plain LoadBalancing code.
If you application only uses plain LoadBalancing you can switch by
1) exchange your local server URI (localhost or 127.0.0.1) with cloud URI (app.exitgamescloud.com)
2) Register an appid https://cloud.exitgames.com/Dashboard0 -
Sorry,You misunderstood my question. I didnt change any code on server side(photon server). I need my existing ios app to connect to photon cloud service.
i have registered and got the appid. i need to know what are the changes to be done on client side code for migrating to photon cloud service.
From the above reply Whether it is possible to connect your demo code (demo_iPhone_realtime_objc) with the photon cloud service by providing the following details in PhotonDemo.mm file
1) In createConnection method
[m_pLitePeer Connect:[NSString stringWithUTF8String:@app.exitgamescloud.com]];
2) Where to provide the appid?.0 -
the realtime demo is not compatible to the Cloud, as it relies on the Lite app running on the serverside, but the Cloud runs the LoadBalancing app instead. So you would have to migrate your client side network logic from Lite to LoadBalancing.
Have a look at the differences between the public APIs of classes LitePeer and LoadBalancingClient for what you have to change. The ingame logic of the LoadBalancing app is pretty much similar to the one of Lite, so it should be quite easy to migrate that part.0 -
LoadBalancing app get crashed continuously in iphone 5.0 stimulator, when i Pressed the create game button (for the second time).On first click action i can able to successfully connect to cloud sever and after that i pressed on leave game button. The crash happened on second time click action for the create game button .0
-
Afaik this is a known bug and a fix will be available with the next release probably by the end of this week.0
-
ok thanks.
How to get the available gameList from the photonCloud as soon as the player get connected?.0 -
nanda wrote:ok thanks.
How to get the available gameList from the photonCloud as soon as the player get connected?.
2. Now the GameList-property will hold the list of open gamerooms, as soon as the client received the initial list-event form the server and the value of this property will alway be on the most up to date state by serverside update events in short intervals, as long as you stay in the lobby. Just leave the lobby, if you don't want to receive further updates on the gamelist anymore.0 -
1.How to access the gameList (which is an NSDictionary) values?. I want to get GameName and number of player playing in each game present in the gameList?
When i printed the gameList in the [networkLogic run] method under STATE_CONNECTED switch case.
"<KeyObject: 0x682c650>" = "<LoadBalancingRoom: 0x682b420>. How to access the values present in the gameList?
2.i am getting "receiveing client 2001 error" which is printed in the console most of time when i tried to connect?0 -
nanda wrote:1.How to access the gameList (which is an NSDictionary) values?. I want to get GameName and number of player playing in each game present in the gameList?
When i printed the gameList in the [networkLogic run] method under STATE_CONNECTED switch case.
"<KeyObject: 0x682c650>" = "<LoadBalancingRoom: 0x682b420>. How to access the values present in the gameList?wprintf(L"gameList: \n"); for(NSUInteger i=0; mClient.GameList.count; ++i) wprintf(L"room %d - name: %ls playerCount: %d\n", i, [mClient.GameList objectForKey:[mClient.GameList.allKeys objectAtIndex:i]].ID.UTF32String, [mClient.GameList objectForKey:[mClient.GameList.allKeys objectAtIndex:i]].PlayerCount); wprintf(L"\n");
nanda wrote:2.i am getting "receiveing client 2001 error" which is printed in the console most of time when i tried to connect?
Of course you should also make sure, that you are calling service() regularly, so that the Photon client can communicate with the server.0 -
thanks kaiseludi for your reply.
A Slight modification in your codewprintf(L"gameList: \n"); for(NSUInteger i=0; i < mLoadBalancingClient.GameList.count; ++i) wprintf(L"room %d - name: %ls playerCount: %d\n", i, [[[mLoadBalancingClient.GameList objectForKey:[mLoadBalancingClient.GameList.allKeys objectAtIndex:i]] ID] UTF32String], [[mLoadBalancingClient.GameList objectForKey:[mLoadBalancingClient.GameList.allKeys objectAtIndex:i]] PlayerCount]); wprintf(L"\n");
How to get notified for the gameList update ?0 -
Currently there is no functionality of notifying the app, that there has been an update of the gamelist, you are just supplied with the most up to date data, but get not informed, when it is getting updated. However this may be added in the future.
For now you can achieve such functionality by subclassing LoadBalancingClient and overriding its onEvent()-method like in the following example:- (void) onEvent:(EventData*)eventData { [super onEvent:eventData]; switch(eventData.Code) { case EventCode::ROOM_LIST: // notify app, that the initial room list event has come in break; case EventCode::ROOM_LIST_UPDATE: // notify app, that a roomlist update event has come in break; default: break; } }
0 -
by Kaiserludi :
Afaik this is a known bug and a fix will be available with the next release probably by the end of this week.
Can i know exact date for bug fix release of ios version.0 -
nanda wrote:by Kaiserludi :
Afaik this is a known bug and a fix will be available with the next release probably by the end of this week.
Can i know exact date for bug fix release of ios version.0 -
hi kaiserludi,
There was one new bug in roomList update. RoomList is not getting updated properly. pls verify it and reply me.
[mLoadBalancingClient opJoinRandomRoom]; is working properly but [mloadBalancingClient opJoinRoom:gameId] is not working properly because of the roomList update.
If you need i will also provide the Log details.
My project is getting delayed pls look in to it and reply me as soon as possible0 -
Hi nanda.
I have just tested it and in my tests roomlists worked just fine:
I went online with 3 clients, client 1 stayed in the lobby all the time and printed out the list of open rooms. Client 2 created a room -> one room listed in the roomlist of client 1. client 3 also created a room -> 2 rooms listed. Client 3 left its room -> 1 room listed. Client 3 joined client 2's room -> now a the one listed room has a playercount of 2.
Perhaps you can explain you test scenario to me, so that I can try to reproduce the exact same situation.
Also please keep in mind, that it takes a small amount of time for the room to get listed.0 -
Your test case is working fine for me too. Have you checked for the roomList in client2 and client3.
pls test for the roomList in client 2 and client 3 .You can see the bug.
If you didnt see the bug try my test case below
My test case:
Two clients(client 1 and client 2).
slight Modified in the [networkLogic run] method as
under the swith case STATE_CONNECTED:case STATE_CONNECTED: //added the code for printing the roomList. for(NSUInteger i=0; i < mLoadBalancingClient.RoomList.count; ++i) NSLog(@"room %d - name: %@ playerCount: %d\n", i, [[mLoadBalancingClient.RoomList objectForKey: [mLoadBalancingClient.RoomList.allKeys objectAtIndex:i]] Name], [[mLoadBalancingClient.RoomList objectForKey:[mLoadBalancingClient.RoomList.allKeys objectAtIndex:i]] PlayerCount]); //rest of the code as you given
1.connect the client 1 and client2 to the lobby.(now roomList in both the client will be empty).
2.Click on the CreateGame button on client 1. ( now the roomList will be updated and show in client 2).
3.Click on the leave game button on client 1. (now roomList will be empty in both client).
4.Now click createGame button on client 2.(roomList will not be updated in the client 1).
[Note: Until you create a room or join room there was no bug as you did for client 1. Try create a game or join a game for the client1 and then test as you said].0 -
Thanks. In that scenario it doesn't work for me, too. I will have a look, whats going wrong there.0
-
nanda wrote:hi kaiserludi,
There was one new bug in roomList update. RoomList is not getting updated properly. pls verify it and reply me.
[mLoadBalancingClient opJoinRandomRoom]; is working properly but [mloadBalancingClient opJoinRoom:gameId] is not working properly because of the roomList update.
If you need i will also provide the Log details.
My project is getting delayed pls look in to it and reply me as soon as possible
However it's fixed now and as you have mentioned, that it is urgent for you and the fix won't get available in the download area before tomorrow, please use this link:
http://dl.dropbox.com/u/4296291/Photon- ... ud_SDK.zip
For your Information:
It has not really been an issue with gamelist-updates, but with automatically joining the lobby, which has not been working, when returning from a gameroom (You only get gamelist updates when inside a lobby, so that you can save your clients from this traffic by not joining it, if you do not use gamelists anyway).0 -
thanks you kaiserludi for your help. Now the roomList is properly updating.
In previous post i asked you about roomList update and you replied withCurrently there is no functionality of notifying the app, that there has been an update of the gamelist, you are just supplied with the most up to date data, but get not informed, when it is getting updated. However this may be added in the future.
For now you can achieve such functionality by subclassing LoadBalancingClient and overriding its onEvent()-method like in the following example:
i have created a new Class called GameListUpdate:LoadBalancingClient
In NetworkLogic.h i have added this code
@class GameListUpdate;
and replaced the LoadBalancingClient* mLoadBalancingClient with GameListUpdate* mLoadBalancingClient;
and in networkLogic.mm i have added this code#import "LoadBalancingClient.h" #import "EventCode.h" @interface GameListUpdate : LoadBalancingClient { } @end @implementation GameListUpdate - (void) onEvent:(EventData*)eventData { NSLog(@"%s",__FUNCTION__); [super onEvent:eventData]; switch(eventData.Code) { case 230: // notify app, that the initial room list event has come in NSLog(@"inside 230"); [[NSNotificationCenter defaultCenter] postNotificationName:@"gameListUpdated" object:nil]; break; case 229: // notify app, that a roomlist update event has come in NSLog(@"inside 229"); [[NSNotificationCenter defaultCenter] postNotificationName:@"gameListUpdated" object:nil]; break; default: break; } } @end
But still i am not receiving any nslog in onEvent method. Am i doing something wrong or please help me with some code for the roomList update notification.0 -
Hi again.
Your code is working perfectly for me.
Have you checked, that you have replaced[LoadBalancingClient alloc]
with[GameListUpdate alloc]
?0 -
i forget to replace it.
ThankYou dude for all your help.0 -
i implemented my game disconnection logic in the
- (void) connectionErrorReturn:(int)errorCode - (void) clientErrorReturn:(int)errorCode - (void) serverErrorReturn:(int)errorCode
i often receive the following message in the gdb2012-02-25 14:50:14,056369 INFO CPhotonPeer.cpp PhotonPeer_internal_send() line: 694 - payload will be sent in 2 fragments 2012-02-25 14:50:14,327160 INFO CPhotonPeer.cpp PhotonPeer_internal_serializeToBuffer() line: 1389 - Info: UDP package is full. Commands in Package: 2 . Commands left in queue: 2 2012-02-25 14:50:14,827085 INFO CPhotonPeer.cpp PhotonPeer_internal_serializeToBuffer() line: 1389 - Info: UDP package is full. Commands in Package: 1 . Commands left in queue: 2 2012-02-25 14:50:15,827100 INFO EnetPeerLayer.cpp sendOutgoingCommands() line: 82 - going to resend pCommand: time: 21999 = 21607 sentCount: 1, original sentTime: 20999 2012-02-25 14:50:15,827195 INFO CPhotonPeer.cpp PhotonPeer_internal_serializeToBuffer() line: 1389 - Info: UDP package is full. Commands in Package: 1 . Commands left in queue: 1 2012-02-25 14:50:17,826943 INFO EnetPeerLayer.cpp sendOutgoingCommands() line: 82 - going to resend pCommand: time: 23998 = 23714 sentCount: 2, original sentTime: 20999 2012-02-25 14:50:20,326901 INFO EnetPeerLayer.cpp sendOutgoingCommands() line: 82 - going to resend pCommand: time: 26498 = 26430 sentCount: 3, original sentTime: 20999 2012-02-25 14:50:20,327009 INFO CPhotonPeer.cpp PhotonPeer_internal_serializeToBuffer() line: 1389 - Info: UDP package is full. Commands in Package: 1 . Commands left in queue: 1 2012-02-25 14:50:20,826839 INFO CPhotonPeer.cpp PhotonPeer_internal_serializeToBuffer() line: 1389 - Info: UDP package is full. Commands in Package: 1 . Commands left in queue: 1 2012-02-25 14:50:25,326656 INFO EnetPeerLayer.cpp sendOutgoingCommands() line: 49 - disconnect due to retry timeout (max retry time) time: 31498 originalSentTime: 20999 2012-02-25 14:50:25.326 SketchWFriendCP[1900:207] -[NetworkLogic connectionErrorReturn:] with errocode = 1040
i am sending the message in unreliable mode.0 -
This shows that some of your operations are too big to be sent in a single udp-packet (one packet is 1.200bytes including overhead, which depending on the kind of data, which you send, means about 1.000bytes of payload) and is therefor automatically split up into 2 fragments. In the case of fragmentation Photon will send all fragments of one operation reliable, no matter if the operation would have been sent unreliable otherwise.0
-
ok kaiserludi, then the only way to fix this bug is we need to check for the data length (1.000bytes of payload)and split it before sending to photon server or suggest me some way to fix this bug.0
-
The reasoning between making fragments reliable is that they are all needed to re-assemble the single but big request.
Unless you turn the big chunk into multiple smaller but "complete" commands, you would only re-implement fragmentation.0