Channel Identifiers For Large Scale Games
Use channel identifiers for large-scale game servers with Vivox.
阅读时间1 分钟最后更新于 7 个月前
如果满足以下任何陈述,则构造频道标识符时需谨慎:
- 期望应用程序超过 100,000 PCU
- 期望使用多频道功能
可以根据 Vivox Operations 的判断将大型游戏拆分为跨多台物理音频服务器(“分片”)。构造通道标识符以使用以下格式:
shard-group
例如,有一个应用程序,名称是“Queen of the Death”(QotD),它根据地理区域分配用户,例如“NA”表示“北美”。假设 QotD 为比赛中的所有参与者加入一个 3D 通道,然后也为队伍的成员加入一个 2D 通道。在此情况下,QotD 的最佳实践是应用以下条件:
- 使用哈希值标识比赛
- 在频道标识符的“shard”部分中包含区域和比赛标识符
- 在通道标识符的“shard”部分后包含 3D 和队伍标识符
为此比赛分配的比赛标识符是 ,3D 空间为 。进一步假定向队伍分配了从 1 开始的整数 ID,并且 Channel3DProperties 已经设置为变量 。
d0634bad1ca5a9cdtundraNewChannelProps-
位置频道string shard = "NA";string matchId = "d0634bad1ca5a9cd";string positionalSpaceId = "tundra";Channel3DProperties NewChannelProps = new Channel3DProperties(/* Add your own custom positional channel proprties here */);await VivoxService.Instance.JoinPositionalChannelAsync($"{shard}.{matchId}-{positionalSpaceId}", ChatCapability.AudioOnly, NewChannelProps);
-
队伍 1 的群组频道string shard = "NA";string matchId = "d0634bad1ca5a9cd";int squadId = 1;await VivoxService.Instance.JoinGroupChannelAsync($"{shard}.{matchId}-{squadId}", ChatCapability.AudioOnly);
-
队伍 2 的群组频道string shard = "NA";string matchId = "d0634bad1ca5a9cd";int squadId = 2;await VivoxService.Instance.JoinGroupChannelAsync($"{shard}.{matchId}-{squadId}", ChatCapability.AudioOnly);