Skip to content

Commit 60cd4c3

Browse files
authored
Update README.md
1 parent 1ad4ddc commit 60cd4c3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,21 @@ Want to contribute? Great! If you find a bug or want to make improvements, simpl
3434

3535
Also - I'm looking for additional maintainers who are still actively using this in production as I now run a startup and am not actively doing engineering work anymore.
3636

37-
### Author
37+
### Nakama Server Usage Example
38+
```C#
39+
private void OnNakamaServerConnect()
40+
{
41+
// Get MonoBehaviour Instance
42+
UnityMainThreadDispatcher mainThread = UnityMainThreadDispatcher.Instance();
43+
44+
// Setup network event handlers.
45+
Connection.GetSocket.ReceivedMatchmakerMatched += m => mainThread.Enqueue(() => OnReceivedMatchmakerMatched(m));
46+
Connection.GetSocket.ReceivedMatchPresence += m => mainThread.Enqueue(() => OnReceivedMatchPresence(m));
47+
Connection.GetSocket.ReceivedMatchState += m => mainThread.Enqueue(async () => await OnReceivedMatchState(m));
48+
}
49+
```
50+
51+
### Author Original realization
3852
@PimDeWitte
3953

4054

0 commit comments

Comments
 (0)