o0Corps0o Posted September 27, 2018 Share Posted September 27, 2018 Hiya, I've made a 1v1 game but I would like it so that when a player has taken a turn, instead of quiting out of the game, I would like it to return to the main menu so they have the option of choosing to play someone else. Is there a way of clearing the context, or changing it so that the opponent doesn't keep getting picked up? Can I just use switchAsync('') or context.createAsync('') and apply a blank value? I tried FBInstant.endGameAsync() but i think this is old and doesn't work any more... Do I have to initialise the game everytime? *Never mind, i've just rewrote my Main Menu code.. but would still be good to know if you can clean out an async* Quote Link to comment Share on other sites More sharing options...
Noel Posted September 28, 2018 Share Posted September 28, 2018 Hi @o0Corps0o, why don't you simply switch to your solo context? FBInstant.context.createAsync(FBInstant.player.getID()) Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted September 28, 2018 Author Share Posted September 28, 2018 Great answer this is what i was looking for.. i just wasn't sure how to access it.. (ie. blanks values etc).. I will give it a shot today! Thanks! I've tried to add this in to the game to try get it back to SOLO context.. but when i try this i get an error: "INVALID_PARAM, At least one player id besides the current player'smust be provided. " I will try switchAsync... *Nope same kind of error "Invalid context id for player" Quote Link to comment Share on other sites More sharing options...
Noel Posted September 28, 2018 Share Posted September 28, 2018 Interesting. I will report that internally. Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted September 28, 2018 Author Share Posted September 28, 2018 Thanks, it'll be good to know, cause i can see this being a handy function Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted October 2, 2018 Author Share Posted October 2, 2018 Was there any updates or news about being able to switch to a solo context? Quote Link to comment Share on other sites More sharing options...
Noel Posted October 3, 2018 Share Posted October 3, 2018 @o0Corps0o Not yet. I do not think you should wait for it as there is no guarantee about when it will be implemented (if it gets implemented). Quote Link to comment Share on other sites More sharing options...
SahJ Posted October 8, 2018 Share Posted October 8, 2018 How did you change the context? Quote Link to comment Share on other sites More sharing options...
o0Corps0o Posted October 8, 2018 Author Share Posted October 8, 2018 In the end I didn't change the context.. I just made a work around, so if it errored with the same context, i just wouldn't change it and go back to the game. (Or send it somewhere else if need be, but this would be all done in the 'catch' part if a new context couldn't be created for whatever reason). Hope that helps.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.