Here is subscribed how you can receive multiplayer broadcast messages from your game server. Firstly, you need to check how to setup multiplayer features on your game server.
You can get a list of bets based on tiers for specific currency:
var currency = "USD";
fireball.GetBetTiers(currency,
(betTiers) =>
{
// check bet tiers
foreach (var betTier in betTiers)
{
Debug.Log($"Bet Tier {betTier.Tier}: {betTier.Value} {currency}");
}
},
(error) =>
{
// handle bet tiers error
Debug.LogError($"Bet Tiers error: {error}");
});
You can subscribe to listen to specific broadcast messages by message Name:
public void OnEnable()
{
fireball.Multiplayer.AddBroadcastListener<SpinResult>("spin-result", OnCustomMessageRecieved);
}
public void OnDisable()
{
fireball.Multiplayer.RemoveBroadcastListener<SpinResult>("spin-result", OnCustomMessageRecieved);
}
private void OnCustomMessageRecieved(BaseMessage message)
{
// check result message
var result = message as SpinResult;
Debug.Log($"Is Won: {result.IsWon}");
Debug.Log($"WinAmount: {result.WinAmount}");
}