added callback for roomdatamessage

main
Anton Franzluebbers 2022-02-03 02:09:21 -05:00
parent 23f475a8a7
commit 2d16a14700
1 changed files with 10 additions and 0 deletions

View File

@ -93,6 +93,7 @@ namespace VelNet
public static Action OnConnectedToServer;
public static Action OnLoggedIn;
public static Action<RoomsMessage> RoomsReceived;
public static Action<RoomDataMessage> RoomDataReceived;
public static Action<Message> MessageReceived;
public static Action<int, byte[]> CustomMessageReceived;
@ -312,6 +313,15 @@ namespace VelNet
case RoomDataMessage rdm:
{
Debug.Log("Got room data message:" + rdm.room);
try
{
RoomDataReceived?.Invoke(rdm);
}
// prevent errors in subscribers from breaking our code
catch (Exception e)
{
Debug.LogError(e);
}
break;
}
case YouJoinedMessage jm: