/// </summary>
public void OnReceiveMessage ( MessageType type , object msg )
{
if ( type = = MessageType . RenameRequest )
{ m_localUser . DisplayName = ( string ) msg ;
}
else if ( type = = MessageType . CreateLobbyRequest )
if ( type = = MessageType . CreateLobbyRequest )
{
var createLobbyData = ( LocalLobby ) msg ;
LobbyAsyncRequests . Instance . CreateLobbyAsync ( createLobbyData . LobbyName , createLobbyData . MaxPlayerCount , createLobbyData . Private , m_localUser , ( r ) = >
} ,
m_lobbyColorFilter ) ;
}
else if ( type = = MessageType . ChangeGameState )
{ SetGameState ( ( GameState ) msg ) ;
else if ( type = = MessageType . QuickJoin )
{
LobbyAsyncRequests . Instance . QuickJoinLobbyAsync ( m_localUser , m_lobbyColorFilter , ( r ) = >
{ lobby . ToLocalLobby . Convert ( r , m_localLobby ) ;
OnJoinedLobby ( ) ;
} ,
OnFailedJoin ) ;
}
else if ( type = = MessageType . RenameRequest )
{ m_localUser . DisplayName = ( string ) msg ;
}
else if ( type = = MessageType . ClientUserApproved )
{ ConfirmApproval ( ) ;
else if ( type = = MessageType . LobbyUserStatus )
{ m_localUser . UserStatus = ( UserStatus ) msg ;
}
else if ( type = = MessageType . StartCountdown )
{ m_localLobby . State = LobbyState . CountDown ;
}
else if ( type = = MessageType . CompleteCountdown )
{ if ( m_relayClient is RelayUtpHost )
( m_relayClient as RelayUtpHost ) . SendInGameState ( ) ;
}
else if ( type = = MessageType . ChangeGameState )
{ SetGameState ( ( GameState ) msg ) ;
}
else if ( type = = MessageType . ConfirmInGameState )
{ m_localUser . UserStatus = UserStatus . InGame ;
{ m_localLobby . State = LobbyState . Lobby ;
SetUserLobbyState ( ) ;
}
else if ( type = = MessageType . QuickJoin )
{
LobbyAsyncRequests . Instance . QuickJoinLobbyAsync ( m_localUser , m_lobbyColorFilter , ( r ) = >
{ lobby . ToLocalLobby . Convert ( r , m_localLobby ) ;
OnJoinedLobby ( ) ;
} ,
OnFailedJoin ) ;
}
else if ( type = = MessageType . SetPlayerSound )
{
var playerSound = ( LobbyUserAudio ) msg ;
}
}