Sign In Register

How can we help you today?

Start a new topic

Adding a player to an ongoing realtime match

Hello, I can't seem to find an answer to this question anywhere, so I thought I'd ask and see how far I get.


I have realtime drop in/out match instances running and I want it so players can join an ongoing match. I have the match id saved on data services once the match is created by a "host" player.


I can't use findpendingmatches since it prevents the host player from actually starting the match, since their match still needs to be pending to be found by other players. I tried using the SparkMultiplayer command addPlayer in cloud code via a my own event, but I get this:


{
  "@class":".GameSparksErrorResponse",
  "error":{
    "message":"Cannot convert 5c345f1cb60fa50518f087ef to com.gamesparks.scripting.SparkPlayer (event/JOINMATCH.js#13)"
  },
  "message":"Cannot convert 5c345f1cb60fa50518f087ef to com.gamesparks.scripting.SparkPlayer (event/JOINMATCH.js#13)",
  "requestId":"636837076827163712_6"
}

 

JoinPendingMatch isn't working for me since the match is not actually "pending."


Any ideas?

1 Comment

Same need here, 

I want to add a friend to the same instance where another player is already playing.

Any tips?

Login to post a comment