Example #1
0
    private static void InitiliazeCloudServices()
    {
        InvitationCallback            myInvitationCallback            = new InvitationCallback(onInvitation);
        TurnBasedNotificationCallback myTurnBasedNotificationCallback = new TurnBasedNotificationCallback(onTurnBasedNotification);
        PlayGamesClientConfiguration  config = new PlayGamesClientConfiguration.Builder()
                                               // enables saving game progress.
                                               .EnableSavedGames()
                                               // registers a callback to handle game invitations received while the game is not running.
                                               //.WithInvitationDelegate(myInvitationCallback)
                                               // registers a callback for turn based match notifications received while the
                                               // game is not running.
                                               //.WithMatchDelegate(myTurnBasedNotificationCallback)
                                               .Build();

        PlayGamesPlatform.InitializeInstance(config);
        // recommended for debugging:
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

        Debug.Log("ELEP - CloudServices initialized");
    }
        public LoggedInForm()
        {
            InitializeComponent();
            invitationContainer.Clear();
            friendsContainer.Clear();

            UsernameCallback callback4 = newInactiveFriendFunc;
            UsernameCallback callback5 = newActiveFriendFunc;
            IdCallback       callback6 = callUserReply;
            BooleanCallback  callback7 = callUserReplyFromUser;
            CallCallback     callback8 = openInCallWindow;
            FriendCallback   callback9 = addToFriendContainer;

            LoggedInService.AddToFriendList                   = callback9;
            LoggedInService.NewInactiveFriend                 = callback4;
            LoggedInService.NewActiveFriend                   = callback5;
            LoggedInService.InviteToConversationReplyOk       = callback6;
            LoggedInService.InviteToConversationReplyFromUser = callback7;
            LoggedInService.OpenInCallForm = callback8;


            StringCallback callback2 = writeToInvitingList;

            LoggedInService.NewInvitationCallback = callback2;
            this.signedInLogin_Text.Text          = Program.username;

            StringCallback callback = writeToFriendContainer;

            LoggedInService.GetFriendsCallback = callback;

            InvitationCallback callback3 = removeFromInvitingList;

            LoggedInService.InvitationProcessedCallback = callback3;

            LoggedInService.getFriends();
        }