Player Disconnect Issue GKMatch and Gamekit - cocos2d-iphone

i am working with cocos2d game with GameKit. I am creating match with 2 player using GKMatch. All thing is working fine for me but When one player enters the background state or pressing home button , then player is disconnected. I want to run GKMatch instance in background also. Please help me.
Thanks in advance.

I don't think that's possible, after all "background" means the player stopped playing.
While the programming guide might not mention that explicity, it does one thing, namely automatically logging in the player when the application enters foreground, which to me indicates there's simply no player GKMatch could be connected with while the app is in the background.

Related

Sending mouse and keyboard input to a unity3d game (Rust)

I would like a python option but that doesn't seem likely, I looked into c++ but I'm not intimately familiar and the methods I tried were not working. I need to be able to move the mouse(which I have been able to do) inside the game (which never works), and to press and or hold keys, AutoHotKey doesn't work for moving the mouse inside of popup dialogs only for controlling recoil and such. I have permission from the admin, I admin on one of his other servers, I'm not looking to release hacks for the game, its just a project I dabbled with for a while and would like to see out.
Does anyone have experience with this or ideas as to how I can simulate input from mouse or keyboard?
i have expeience in ahk and game bot making
https://www.youtube.com/user/FloowSnaake/videos

Multiplayer Spawning in UE4 blueprint

i want to create a local multiplayer game for 2-4 players.
It seems like i have made a mistake or it is a bug. I tried different tutorials but i dont get my mistake. I posted the same question in the answer hub of unreal, but i didn´t get a response. Here ist my gamemode and the spawning function:
GamemodeSpawning
My Pawn is called Physics Ball BP. The default spawn in the gamemode is disabled. The default value of the variable "Max Player Amount" is 2. "Player Start Array" contains the PlayerStarts. The PlayerStarts have the tag "0" and "1". This is my viewport before the start:
Viewport
This is my viewport if i press Play: ViewportPlaying
I think i just missed something basic, but i cant figure out what i´ve done wrong. I hope you can help me.
best regards chris
Not sure if you did it on purpose but you uploaded the same screenshot of your viewport twice. Maybe edit your post, and upload the right ones.
But maybe the problem your having is because you forgot to plug your Index variable into the Player Int variable in the Spawn Actor node?

how to reset game in cocos2d

My question in the previous post was-
I have a cocos2d game, and after I
exit the game and start it again, it
starts at the exact same point it was
before closing.why this is
happening??and not only this, my game
is landscapemode but when I start it
again from simulator it comes in
portrait mode,not it landscapemode like
first time.
Is there any way to prevent this?
Anyone will come to rescue me???
I found a solution.Is it good??
when I exit the game(by pressing the back button in iPhone simulator) this problem occurred. Now I found that if I press back button the following function is called-
(void)applicationWillResignActive:(UIApplication *)application
So I set (divide by zero) or something like this in -(void)applicationWillResignActive function so that when this function called the application crashes. Then if I restart the application everything comes from beginning(reset) which I want. Is it good solution or anything better?
*my applicationDidFinishLaunching was not called again when application is restart from simulator.
You should configure the Info.plist to indicate that you does not want your application run in Background.
The key is
UIApplicationExitsOnSuspend
If you need more detail you should look at this tutorial
If you have iOS 4.0 or higher, multitasking is causing your problem.

cocos2d game reset problem

I have a cocos2d game, and after I exit the game and start it again, it starts at the exact same point it was before closing.why this is happening??and not only this, my game is landscapemode but when i start it again from simulator it comes in potrait mode,not it landscapemode like first time.
Is there any way to prevent this?
Anyone will come to rescue me???
From iOS 4.0, there are new options for "info.plist" file.
If you do not want to add multi-tasking(running in background), just add it.
You can add the option by just clicking and checking in your game project's "info.plist".
And rotation setting is on your "RootViewController.m" file.
You can change your app direction by just changing return value.
I hope your game will work well.

Passing the "enter key" event to flash player in an ATL Window?

I have a Flash player (flash9.ocx) embedded in an ATL window and have coded functionality into the swf to respond to the return/enter key being pressed.
Works fine from the standalone swf player but as soon as its played from within my embedded player it doesn't execute. It's as if my window is getting in the way somehow?
Is there any way to pass the keypress through to the player?
FYI, there isn't anything to weird in place on the form.
Thanks!
I'm not VC++ developer, but I use Flash a lot.
Though not sure, it seems that the embedded player doesn't have the focus. Make sure you've got this part covered on the Flash side of things:
the stage exists ( you movie is properly initialized)
you set the KeyboardEvent listener to the stage.
You could use the FocusManager to make sure you've got the focus.
I don't know if you can pass the focus from you app to the SWF OLE through some tabIndex or something.
If still this doesn't work you can try using the External Interface to add callbacks from your app to flash player ( basically call and actionscript function from your app ).
This was achieved through fscommand before, but External Interface seems to be the thing to use now.
Good luck!
I don't use flash a lot but i'm a C++ programmer. =)
Let's see if I can help you.
I believe that your application is catching all the events before your flash movie. I don't know if there is a better way to do this but you could listen for any keyboard event on your form and use the SetVariable of your ActiveX component to set a variable inside Flash. Then, in the Flash Movie you could set a watch for any changes on this variable and trigger your Enter event.
Hope this helps.