- Home /
Question by
J_LTD · Nov 04, 2016 at 08:20 PM ·
multiplayermatchmaking
Matchmaker does not find any matches
I am trying to make a lobby for my first person shooter, and i want to have a scrollview with all available matches. But when I make a match it does not find any matches. Any idea what messed up?
public void RefreshRoomList() { ClearRoomList(); networkManager.matchMaker.ListMatches(0, 20, "", true, 0, 0, OnMatchList); status.text = "Loading..."; }
public void OnMatchList(bool succes,string extendedInfo,List<MatchInfoSnapshot> matchList)
{
status.text = "";
if(!succes || matchList == null)
{
status.text = "Couldn't get room list. That is all we know";
return;
}
foreach (MatchInfoSnapshot match in matchList)
{
GameObject roomListItemGO = Instantiate(roomListItemPrefab);
roomListItemGO.transform.SetParent(roomListParent);
RoomListItem roomListItem = roomListItemGO.GetComponent<RoomListItem>();
if(roomListItem != null)
{
roomListItem.Setup(match, JoinRoom);
}
roomList.Add(roomListItemGO);
}
if (roomList.Count == 0)
{
status.text = "No room at the moment, make your own room!, it is free!!!";
}
}
Comment
Oops messed op pasting my code the code at the bottom of my question is a part of the script underneath.
Best Answer
Answer by J_LTD · Nov 04, 2016 at 09:10 PM
Fixed it, the problem was that i was hosting my server on the localhost.