Example #1
0
    public static void Authenticate(Gamedonia.CredentialsType authenticationType, Dictionary <string, object> credentials, Action <bool> callback)
    {
        IGamedoniaAuthentication authentication = null;

        switch (authenticationType)
        {
        case Gamedonia.CredentialsType.GAMECENTER:
            authentication = new GamecenterAuthentication();
            break;

        case Gamedonia.CredentialsType.FACEBOOK:
            authentication = new FacebookAuthentication((string)credentials["fb_uid"], (string)credentials["fb_access_token"]);
            break;

        case Gamedonia.CredentialsType.SILENT:
            authentication = new SilentAuthentication();
            break;

        default:
            authentication = new SessionTokenAuthentication();
            break;
        }

        authentication.Authenticate(callback);
    }
    public static void Authenticate(Gamedonia.CredentialsType authenticationType, Dictionary<string,object> credentials, Action<bool> callback)
    {
        IGamedoniaAuthentication authentication = null;
        switch (authenticationType) {
            case Gamedonia.CredentialsType.GAMECENTER:
                authentication = new GamecenterAuthentication();
                break;
            case Gamedonia.CredentialsType.FACEBOOK:
                authentication = new FacebookAuthentication((string) credentials["fb_uid"], (string) credentials["fb_access_token"]);
                break;
            case Gamedonia.CredentialsType.SILENT:
                authentication = new SilentAuthentication();
                break;
            default:
                authentication = new SessionTokenAuthentication();
                break;
        }

        authentication.Authenticate(callback);
    }