This article details how to monitor the size of your channels when you want to fill the channels with as many users as possible. The methods listed in this article can help to ensure that your large-scale channels remain under the 200 user limit.
Note: Each method needs to include a catch for the VxXmppServerErrorServiceUnavailable (20502)
error. This error is thrown when the 201st user attempts to join the channel. If you ever accidentally hit this error, catch the error and try to join another channel. However, keep in mind that following these methods can prevent this error from occurring a majority of the time.
First method: User buffer
Note: This method does not require a game server.
- Benefits: Allows you to manage channel size without a game server
- Drawbacks: Limits the channel size to 100 users
- Have the player join the channel.
- On the participant added event, check to see if the participant being added is the player.
- If the participant being added is the player, go to Step 3.
- Check the participant list count.
- If the list count is under 100 users, have the player join the channel.
- If the list count is equal to or is over 100 users, have the player try to join the next channel.
Second method: Roster list
Note: This method requires a game server.
- Benefits: Quick updates to count
- Drawbacks: Requires extensive usage on a server
When using this method, you need to monitor the functionality of the channel. Check the channel size before a user attempts to join the channel.
Monitoring functionality
- Create a roster list by adding users when they join the channel.
- Have each user in the channel ping your game server periodically to confirm that they are still connected to the channel.
Note: You can use any time frame that you prefer, but it is recommended that you use about 30 seconds. - If a user misses two pings, remove them from the roster list.
Checking channel size
Grab the size of the channel from the roster list count.
- If the size is less than 200, have the player join the channel.
- If the size is equal to 200, have the player try the next channel.
Caution: Because your server will be receiving pings from up to 200 users at a time for each channel in use, this method might be very extensive for your server.
Third method: Moderators
Note: This method requires a game server.
- Benefits: Requires significantly less extensive usage on a server
- Drawbacks: Delays in updates by 5 to 10 minutes
When using this method, you need to monitor the functionality of the channel. Check the channel size before a user attempts to join the channel.
Monitoring functionality
- Have a few players from the channel randomly selected to be "moderators" of the channel.
Note: Players do not need to know that they are a moderator. Multiple players are set as moderators, so you still receive reports if one of them unexpectedly drops out. - Check player events while they are in the channel, and increase or decrease the channel count as these moderators see other players join or leave.
- Whenever moderators see a participant added event, increase the count
- Whenever moderators see a participant removed, decrease the count.
- Grab the first report received by a moderator and adjust the count accordingly.
- If you receive another report with the same information, do not adjust the count.
- If one of the moderators leaves the channel, or if you notice that one of the moderators are no longer sending pings, then randomly select another player to be a moderator.
Checking channel size
Check the channel size before attempting to join.
- If the size is less than 200, have the player join the channel.
- If the size is equal to 200, try the next channel.
Comments
0 comments
Article is closed for comments.