• Visit Rebornbuddy
  • Anywhere in the API to know RB's version at runtime?

    Discussion in 'Community Developer Forum' started by Neverdyne, Jan 7, 2016.

    1. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Is there any way to know if RB is the English or Chinese version at runtime?
       
    2. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      You could set your own value in a constant and use the compile condition
      Code:
      #if RB_CN
      public static readonly string Locale = "CN";
      #else
      public static readonly string Locale = "EN";
      #endif
      
      I'm not sure if there is a place that mastahg is already storing this, but I do know it displays a log value at startup.
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,231
      Likes Received:
      364
      Trophy Points:
      83
      RB_CN is defined for the Chinese client and RB_KR for the Korean client. You can just use #if (!RB_CN && !RB_KR) or #elseif.
       
    4. RahlRB

      RahlRB New Member

      Joined:
      Sep 24, 2015
      Messages:
      20
      Likes Received:
      2
      Trophy Points:
      0
      I'm not trying to be rude, but that doesn't really answer the question. I think most community developers know about the Conditional Compilation Symbols for RB_CN and RB_KR. I think that Neverdyne is asking if there's a way to know what client the customer is using at RUNTIME not compile time.
       
    5. ExMatt

      ExMatt Active Member

      Joined:
      Jul 5, 2015
      Messages:
      1,030
      Likes Received:
      14
      Trophy Points:
      38
      The example I provided would allow a check to be done at runtime due to the compile time conditionals.
       
    6. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Thanks guys, I'll use ExMatt's idea.
       

    Share This Page