Exemplo n.º 1
0
        public unsafe Connect(ConnectConfig cc)
        {
            NativeMethods.LoadClass();
            //ConsoleHelper.AllocConsole();
            // attach a console to parent process (launch from cmd.exe)
            //ConsoleHelper.AttachConsole(-1);

            CONNECT_CONFIG libcCc = new CONNECT_CONFIG();

            connectConfig = cc;
            IntPtr intptr = new IntPtr(this.GetHashCode());

            refKeeper[intptr] = this;

            libcCc.ccAppId         = cc.ccAppId;
            libcCc.ccAnonymousBlob = cc.anonymousblob;
            //libcCc.ccAppSecret = cc.ccAppSecret;
            libcCc.ccProductBuildId  = cc.product_build_id;
            libcCc.ccProductId       = cc.product_id;
            libcCc.ccUserProfilePath = UTF8Marshaler.GetInstance(null).MarshalManagedToNative(cc.ccUserProfilePath);
            libcCc.ccConnectEventCb  = delegate(CONNECT * libcConnect, CONNECT_EVENT *libcConnectEvent, IntPtr userdata)
            {
                Connect      connect      = (Connect)refKeeper[userdata];
                ConnectEvent connectEvent = ConnectEvent.newFromLibcEvent(libcConnectEvent);

                connect.connectConfig.ccConnectEventCb.Invoke(connect, connectEvent);
            };

            libcConnectHndl = dz_connect_new(libcCc);

            UTF8Marshaler.GetInstance(null).CleanUpNativeData(libcCc.ccUserProfilePath);
        }
Exemplo n.º 2
0
 static extern unsafe PLAYER *dz_player_new(CONNECT *lpcc);
Exemplo n.º 3
0
 static extern unsafe ERRORS dz_player_deactivate(
     CONNECT *dzConnect, IntPtr cb, IntPtr userdata);
Exemplo n.º 4
0
 static extern unsafe ERRORS dz_connect_cache_flush(CONNECT *dzConnect, IntPtr cb, IntPtr userData);
Exemplo n.º 5
0
 static extern unsafe ERRORS dz_connect_offline_mode(CONNECT *dzConnect, IntPtr cb, IntPtr userData, bool offlineMode);
Exemplo n.º 6
0
 static extern unsafe ERRORS dz_connect_smartcache_quota_set(
     CONNECT *dzConnect, IntPtr cb, IntPtr userdata,
     uint quota_kB);
Exemplo n.º 7
0
 static extern unsafe ulong dz_connect_cache_current_size(
     CONNECT *dzConnect);
Exemplo n.º 8
0
 static extern unsafe ERRORS dz_connect_cache_eventcb_set(
     CONNECT *dzConnect, IntPtr cb, IntPtr userdata, libcOnCacheEvent onCache);
Exemplo n.º 9
0
 static extern unsafe ERRORS dz_connect_cache_path_set(
     CONNECT *dzConnect, IntPtr cb, IntPtr userdata,
     [MarshalAs(UnmanagedType.CustomMarshaler,
                MarshalTypeRef = typeof(UTF8Marshaler))]
     string local_path);
Exemplo n.º 10
0
 static extern unsafe ERRORS dz_connect_set_access_token(
     CONNECT *dzConnect, IntPtr cb, IntPtr userdata, string access_token);
Exemplo n.º 11
0
 static extern unsafe ERRORS dz_connect_activate(
     CONNECT *dzConnect, IntPtr userdata);
Exemplo n.º 12
0
 static extern unsafe IntPtr dz_connect_get_device_id(
     CONNECT *dzConnect);