Skip to content

Commit d6a58c3

Browse files
committed
Fixed wiki issue in connection approval
1 parent 981a84f commit d6a58c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/_docs/getting-started/connection-approval.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ private void Setup()
1313
NetworkingManager.singleton.StartHost();
1414
}
1515

16-
private void ApprovalCheck(byte[] connectionData, uint clientId, ConnectionApprovedDelegate callback)
16+
private void ApprovalCheck(byte[] connectionData, uint clientId, MLAPI.NetworkingManager.ConnectionApprovedDelegate callback)
1717
{
1818
//Your logic here
1919
bool approve = true;
20+
21+
int prefabId = SpawnManager.GetNetworkedPrefabIndexOfName("myPrefabName"); // The prefab index. Use -1 to use the default player prefab.
22+
2023
//If approve is true, the connection gets added. If it's false. The client gets disconnected
21-
callback(clientId, approve, positionToSpawnAt, rotationToSpawnWith);
24+
callback(clientId, prefabId, approve, positionToSpawnAt, rotationToSpawnWith);
2225
}
2326
```
2427
### Connection data

0 commit comments

Comments
 (0)