I'm setting up multiplayer matchmaking features for a windows phone game using Shephertz Appwarp API. I've followed this documentation:Matchmaking with Appwarp and successfully setup a find a friend by ID function, but run into problems with matchmaking with random opponents.
I'm creating a dictionary as follows:
public class Matchmake : Microsoft.Xna.Framework.Game
{
public static Dictionary<string, object> tableProperties = new Dictionary<string, object>();
protected override void Initialize()
{
tableProperties.Add("IsPrivateRoom", "false");
}
}
Then executing this:
WarpClient.GetInstance().JoinRoomWithProperties(tableProperties);
In my Room Request Listener it then checks the result:
public void onJoinRoomDone(RoomEvent eventObj)
{
if (Matchmake.searchGame == true)
{
if (eventObj.getResult() == WarpResponseResultCode.SUCCESS)
{
if (Matchmake.hostingRandomGame == false)
{
Matchmake.UIstate = 7;
Matchmake.idRef = eventObj.getData().getId();
}
Matchmake.warpClient.SubscribeRoom(Matchmake.idRef);
}
else
{
Matchmake.warpClient.CreateRoom("CreatedRoom", Matchmake.localUsername, 2, Matchmake.tableProperties);
Matchmake.UIstate = 8;
}
}
After finishing the rest of the code & debugging I can see the room is created ok for player1 from the Else code, and they're subscribed and getting live updates. But when player2 executes the same code on another handset, its not getting a SUCCESS result after looking up the room by the Dictionary, instead its creating a new game too by executing the Else code. Its not being caused by the hostingRandomGame bool either. Anyone have any ideas? Any help would be really appreciated, I can't find a solution in the API documentation, and I'm at a dead end on this. -XDev