Forge Developers | Slack Search | Trello Board Changelog
|
Forge Networking Remastered has been released!!! This is now listed in your Profile!
Go Back

Getting Host List from Master Server - Pagination

Pagination is a way of limiting the amount of information sent at a single given time. Often you will only need a few results at once and then ping the Master Server for the next set of hosts. By default the amount of hosts returned from the static "GetHosts" method of the ForgeMasterServer class will be 15.

Changing the Returned Server Count

You can change this by going into the ForgeMasterServer.cs file and changing the value of the "COUNT_PER_PAGE" constant variable.

How Pagination Works

The second argument to the static "ForgeMasterServer.GetHosts" method is the "pageNumber". This is the current "page" that you are on for hosts. This is a zero based number and must start from 0 if you want the first items in the list.

When you pass a number into this method it will get that page number. So if the default return count is 15 and I pass page number 0 then I will get hosts 0 - 14 (zero based array). If I were to pass in the value 1 then I will get hosts 15 - 29. If I pass a page number of 2 then I will get hosts 30 - 44 and so on.

Title

Body

Title

Body


Input:

Title

Body


Input: