Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    plugin serials broken after 11.5 update

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 556 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 06/09/2009 at 17:15, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      Hi,

      after some of my customers updated their R11 to 11.5, my plugin asks them for serials everytime and refuses the R11 plugin serials. Thsi is quite strange, as plugin serials are generated from the c4d base serials.

      Maybe this has sth to do with the way that i check my serials ?

      It's a tool plugin that checks the serial everytime it is inited. Thus if a wrong serial is written with WritePluginInfo, the serial dialog pops up. Cant see nothing wrong with that though..

      I somehow have the feeling its the compare part of expected serial vs. entered serial that fails.
      Maybe its bc the saved serial is a String converted to LONG and the expected serial is a LONG ?

      greetings,
      Daniel

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 07/09/2009 at 06:52, xxxxxxxx wrote:

        Just an idea. Make sure if the user is running a license server to use WriteRegInfo() instead of WritePluginInfo().

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 12/09/2009 at 04:49, xxxxxxxx wrote:

          Hi,

          thanks for the hint. i have that switch already and the customer doesnt have licServer, so thats not it.

          Now that my 11.5 arrived, i could do some more testing and found the critical line that fails in 11.5 opposed to earlier versions.

          It looks like serial conversion from String to LONG for some reason always returns 0 ..

          am i doing sth wrong or do i have to consider some change in the API ?

          here's the code:

          > <code>
          > // compares given and expected serials
          >      static Bool Validate(CHAR *givenSerial){          
          >           // this is the one valid serial that we expect from the user
          >           LONG ser = computeSerial();     
          >           // the serial given by user / saved to system
          >           String saved;          
          >           saved.SetCString(givenSerial,SERIAL_SIZE);               
          >           LONG savedNr = saved.StringToLong(NULL);          
          >           
          >           LONG diff = ser-savedNr;
          >           if(diff==0L){
          >                if(debug)GePrint("POS serial is valid!");
          >                return TRUE;
          >           }
          >           else{
          >                if(debug)GePrint("POS serial is not valid!");
          >                return FALSE;     
          >           }
          >      }
          > </code>

          this code worked fine before in R9.1 - R11, but now it always fails..

          greetings,
          Daniel

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 12/09/2009 at 10:00, xxxxxxxx wrote:

            Quote: Originally posted by cineast2008 on 12 September 2009
            >
            > * * *
            >
            > Hi,
            >
            > thanks for the hint. i have that switch already and the customer doesnt have licServer, so thats not it.
            >
            > Now that my 11.5 arrived, i could do some more testing and found the critical line that fails in 11.5 opposed to earlier versions.
            >
            > It looks like serial conversion from String to LONG for some reason always returns 0 ..
            >
            > am i doing sth wrong or do i have to consider some change in the API ?
            >
            > here's the code:
            >
            >
            >> <code>
            > // compares given and expected serials
            >      static Bool Validate(CHAR *givenSerial){          
            >           // this is the one valid serial that we expect from the user
            >           LONG ser = computeSerial();     
            >           // the serial given by user / saved to system
            >           String saved;          
            >           saved.SetCString(givenSerial,SERIAL_SIZE);               
            >           LONG savedNr = saved.StringToLong(NULL);          
            >           
            >           LONG diff = ser-savedNr;
            >           if(diff==0L){
            >                if(debug)GePrint("POS serial is valid!");
            >                return TRUE;
            >           }
            >           else{
            >                if(debug)GePrint("POS serial is not valid!");
            >                return FALSE;     
            >           }
            >      }
            > </code>
            >
            >
            >
            > this code worked fine before in R9.1 - R11, but now it always fails..
            >
            >
            > greetings,
            > Daniel
            >
            >
            >
            >
            >
            > * * *

            Your code will fail, as soon as the serial number exceeds 2^31 - 1 (which is the max. number for LONG). That can already happen with a 10 digit serial number.

            In your case you specify a 12 digit number when calling SetCString ...

            Best regards,

            Wilfried Behne

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 12/09/2009 at 10:26, xxxxxxxx wrote:

              Hi.

              My serials are only about 8 digits actually, so range of LONG shouldnt be a problem 😉

              My problem is that this line

                
              LONG savedNr = saved.StringToLong(NULL);   
              

              puts a zero in savedNr, even though the string 'saved' is my valid (non-zero) serial, when printed to the console.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 12/09/2009 at 10:44, xxxxxxxx wrote:

                Quote: Originally posted by cineast2008 on 12 September 2009
                >
                > * * *
                >
                > Hi.
                >
                > My serials are only about 8 digits actually, so range of LONG shouldnt be a problem 😉
                >
                > My problem is that this line
                > <CODE>
                > LONG savedNr = saved.StringToLong(NULL);
                > [\CODE]
                > puts a zero in savedNr, even though the string 'saved' is my valid (non-zero) serial, when printed to the console.
                >
                >
                > * * *

                I'd guess your problem is this line:

                > Quote: __
                >
                > * * *
                >
                > <CODE>
                > saved.SetCString(givenSerial,SERIAL_SIZE);    
                > [\CODE]
                >
                >
                > * * *

                I checked it with serial sizes up to ten digits (#define SERIAL_SIZE 10) and it works. If StringToLong() delivers 0 (you should also check the err value instead of setting a NULL pointer), your String has exceeded that size (e.g. char string not properly terminated or trashed) or isn't a number (e.g. digits mixed with alpha numericals).

                Best regards,

                Wilfried Behne

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 12/09/2009 at 11:45, xxxxxxxx wrote:

                  ah yes, i think thats it.

                  while my serials are about 8 digits, SERIAL_SIZE was still at 12 (from the sdk example).

                  Thus there were probably some non-number digits in it, causing stringToLong to fail.
                  didnt have a prob with that before 11.5 tho..

                  greetings,
                  Daniel

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post