Advertisement
kamil2321

IS c++

Mar 20th, 2019
981
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.30 KB | None | 0 0
  1. // Znajdź całość:
  2. ACMD(do_in_game_mall)
  3. // I całość zamień na:
  4.  
  5. #ifdef __ENABLE_ITEMSHOP_IN_GAME__
  6. ACMD(do_in_game_mall)
  7. {
  8.     ch->ChatPacket(CHAT_TYPE_COMMAND, "mall");
  9. }
  10. #else
  11. ACMD(do_in_game_mall)
  12. {
  13.     if (LC_IsYMIR() == true || LC_IsKorea() == true)
  14.     {
  15.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://metin2.co.kr/04_mall/mall/login.htm");
  16.         return;
  17.     }
  18.  
  19.     if (true == LC_IsTaiwan())
  20.     {
  21.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://203.69.141.203/mall/mall/item_main.htm");
  22.         return;
  23.     }
  24.  
  25.     // ¤Đ_¤Đ ÄčµµĽ­ąö ľĆŔĚĹ۸ô URL ÇϵĺÄÚµů Ăß°ˇ
  26.     if (true == LC_IsWE_Korea())
  27.     {
  28.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://metin2.co.kr/50_we_mall/mall/login.htm");
  29.         return;
  30.     }
  31.  
  32.     if (LC_IsJapan() == true)
  33.     {
  34.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://mt2.oge.jp/itemmall/itemList.php");
  35.         return;
  36.     }
  37.    
  38.     if (LC_IsNewCIBN() == true && test_server)
  39.     {
  40.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://218.99.6.51/04_mall/mall/login.htm");
  41.         return;
  42.     }
  43.  
  44.     if (LC_IsSingapore() == true)
  45.     {
  46.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://www.metin2.sg/ishop.php");
  47.         return;
  48.     }  
  49.    
  50.     /*
  51.     if (LC_IsCanada() == true)
  52.     {
  53.         ch->ChatPacket(CHAT_TYPE_COMMAND, "mall http://mall.z8games.com/mall_entry.aspx?tb=m2");
  54.         return;
  55.     }*/
  56.  
  57.     if (LC_IsEurope() == true)
  58.     {
  59.         char country_code[3];
  60.  
  61.         switch (LC_GetLocalType())
  62.         {
  63.             case LC_GERMANY:    country_code[0] = 'd'; country_code[1] = 'e'; country_code[2] = '\0'; break;
  64.             case LC_FRANCE:     country_code[0] = 'f'; country_code[1] = 'r'; country_code[2] = '\0'; break;
  65.             case LC_ITALY:      country_code[0] = 'i'; country_code[1] = 't'; country_code[2] = '\0'; break;
  66.             case LC_SPAIN:      country_code[0] = 'e'; country_code[1] = 's'; country_code[2] = '\0'; break;
  67.             case LC_UK:         country_code[0] = 'e'; country_code[1] = 'n'; country_code[2] = '\0'; break;
  68.             case LC_TURKEY:     country_code[0] = 't'; country_code[1] = 'r'; country_code[2] = '\0'; break;
  69.             case LC_POLAND:     country_code[0] = 'p'; country_code[1] = 'l'; country_code[2] = '\0'; break;
  70.             case LC_PORTUGAL:   country_code[0] = 'p'; country_code[1] = 't'; country_code[2] = '\0'; break;
  71.             case LC_GREEK:      country_code[0] = 'g'; country_code[1] = 'r'; country_code[2] = '\0'; break;
  72.             case LC_RUSSIA:     country_code[0] = 'r'; country_code[1] = 'u'; country_code[2] = '\0'; break;
  73.             case LC_DENMARK:    country_code[0] = 'd'; country_code[1] = 'k'; country_code[2] = '\0'; break;
  74.             case LC_BULGARIA:   country_code[0] = 'b'; country_code[1] = 'g'; country_code[2] = '\0'; break;
  75.             case LC_CROATIA:    country_code[0] = 'h'; country_code[1] = 'r'; country_code[2] = '\0'; break;
  76.             case LC_MEXICO:     country_code[0] = 'm'; country_code[1] = 'x'; country_code[2] = '\0'; break;
  77.             case LC_ARABIA:     country_code[0] = 'a'; country_code[1] = 'e'; country_code[2] = '\0'; break;
  78.             case LC_CZECH:      country_code[0] = 'c'; country_code[1] = 'z'; country_code[2] = '\0'; break;
  79.             case LC_ROMANIA:    country_code[0] = 'r'; country_code[1] = 'o'; country_code[2] = '\0'; break;
  80.             case LC_HUNGARY:    country_code[0] = 'h'; country_code[1] = 'u'; country_code[2] = '\0'; break;
  81.             case LC_NETHERLANDS: country_code[0] = 'n'; country_code[1] = 'l'; country_code[2] = '\0'; break;
  82.             case LC_USA:        country_code[0] = 'u'; country_code[1] = 's'; country_code[2] = '\0'; break;
  83.             case LC_CANADA: country_code[0] = 'c'; country_code[1] = 'a'; country_code[2] = '\0'; break;
  84.             default:
  85.                 if (test_server == true)
  86.                 {
  87.                     country_code[0] = 'd'; country_code[1] = 'e'; country_code[2] = '\0';
  88.                 }
  89.                 break;
  90.         }
  91.  
  92.         char buf[512+1];
  93.         char sas[33];
  94.         MD5_CTX ctx;
  95.         const char sas_key[] = "GF9001";
  96.  
  97.         snprintf(buf, sizeof(buf), "%u%u%s", ch->GetPlayerID(), ch->GetAID(), sas_key);
  98.  
  99.         MD5Init(&ctx);
  100.         MD5Update(&ctx, (const unsigned char *) buf, strlen(buf));
  101. #ifdef __FreeBSD__
  102.         MD5End(&ctx, sas);
  103. #else
  104.         static const char hex[] = "0123456789abcdef";
  105.         unsigned char digest[16];
  106.         MD5Final(digest, &ctx);
  107.         int i;
  108.         for (i = 0; i < 16; ++i) {
  109.             sas[i+i] = hex[digest[i] >> 4];
  110.             sas[i+i+1] = hex[digest[i] & 0x0f];
  111.         }
  112.         sas[i+i] = '\0';
  113. #endif
  114.  
  115.         snprintf(buf, sizeof(buf), "mall http://%s/ishop?pid=%u&c=%s&sid=%d&sas=%s",
  116.                 g_strWebMallURL.c_str(), ch->GetPlayerID(), country_code, g_server_id, sas);
  117.  
  118.         ch->ChatPacket(CHAT_TYPE_COMMAND, buf);
  119.     }
  120. }
  121.  
  122. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement