| | 1 | | using DCL.Helpers; |
| | 2 | | using System; |
| | 3 | | using UnityEngine; |
| | 4 | | using static DCL.Interface.WebInterface; |
| | 5 | |
|
| | 6 | | namespace DCL |
| | 7 | | { |
| | 8 | | public class RealmsInfoBridge : MonoBehaviour |
| | 9 | | { |
| | 10 | | public static event Action<JumpInPayload> OnRealmConnectionSuccess; |
| | 11 | | public static event Action<JumpInPayload> OnRealmConnectionFailed; |
| | 12 | |
|
| 53 | 13 | | RealmsInfoHandler handler = new RealmsInfoHandler(); |
| | 14 | |
|
| 0 | 15 | | public void UpdateRealmsInfo(string payload) { handler.Set(payload); } |
| | 16 | |
|
| | 17 | | public void ConnectionToRealmSuccess(string json) |
| | 18 | | { |
| 0 | 19 | | var realmConnectionSuccessPayload = Utils.SafeFromJson<JumpInPayload>(json); |
| 0 | 20 | | OnRealmConnectionSuccess?.Invoke(realmConnectionSuccessPayload); |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | public void ConnectionToRealmFailed(string json) |
| | 24 | | { |
| 0 | 25 | | var realmConnectionFailedPayload = Utils.SafeFromJson<JumpInPayload>(json); |
| 0 | 26 | | OnRealmConnectionFailed?.Invoke(realmConnectionFailedPayload); |
| 0 | 27 | | } |
| | 28 | | } |
| | 29 | | } |