0

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

xDev
  • 3
  • 2
  • 1
    After joining the room from first client - do you by any chance update the properties of the room? Do you also get the same issue with the catapult wars sample from the shephertz blog? – dhruv chopra Nov 28 '13 at 14:40
  • Hi @dhruv , that's exactly what it was! I was missing the call to update the properties of the room. So now when the first player has subscribed I update the room with UpdateRoomProperties and it works perfectly. Thanks for your help! – xDev Nov 28 '13 at 21:25

0 Answers0