Exemplo n.º 1
0
    new void Awake()
    {
        Debug.Log("*** GUEST ***");

        Assert.IsNotNull(context);

        state = GuestState.LoggingIn;

        InitializePlatformSDK(GetEntitlementCallback);

        Matchmaking.SetMatchFoundNotificationCallback(MatchFoundCallback);

        Rooms.SetUpdateNotificationCallback(RoomUpdatedCallback);

        Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);

        Net.SetPeerConnectRequestCallback(PeerConnectRequestCallback);

        Net.SetConnectionStateChangedCallback(ConnectionStateChangedCallback);

        Voip.SetVoipConnectRequestCallback((Message <NetworkingPeer> msg) =>
        {
            Debug.Log("Accepting voice connection from " + msg.Data.ID);
            Voip.Accept(msg.Data.ID);
        });

        Voip.SetVoipStateChangeCallback((Message <NetworkingPeer> msg) =>
        {
            Debug.LogFormat("Voice state changed to {1} for user {0}", msg.Data.ID, msg.Data.State);
        });
    }
Exemplo n.º 2
0
        void Start()
        {
            Matchmaking.SetMatchFoundNotificationCallback(MatchFoundCallback);
            Rooms.SetUpdateNotificationCallback(MatchmakingRoomUpdateCallback);

            TransitionToState(MatchRoomState.None);
        }
Exemplo n.º 3
0
        public MatchmakingManager()
        {
            m_remotePlayers = new Dictionary <ulong, User>();

            Matchmaking.SetMatchFoundNotificationCallback(MatchFoundCallback);
            Rooms.SetUpdateNotificationCallback(MatchmakingRoomUpdateCallback);
        }
Exemplo n.º 4
0
        // Use this for initialization
        void Start()
        {
            currentState      = states.NOT_INIT;
            localUser         = null;
            remoteUser        = null;
            currentRoom       = null;
            lastPacketID      = 0;
            ratedMatchStarted = false;

            Core.Initialize();

            // Setup our room update handler
            Rooms.SetUpdateNotificationCallback(updateRoom);
            // Setup our match found handler
            Matchmaking.SetMatchFoundNotificationCallback(foundMatch);

            checkEntitlement();
        }