Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. bool CClientManager::MirrorItemTableIntoDB()
  2. {
  3. for (itertype(m_vec_itemTable) it = m_vec_itemTable.begin(); it != m_vec_itemTable.end(); it++)
  4. {
  5. const TItemTable& t = *it;
  6. char query[4096];
  7. snprintf(query, sizeof(query),
  8. "replace into item_proto%s "
  9. "("
  10. "vnum, "
  11. "name, "
  12. "locale_name, "
  13. "type, "
  14. "subtype, "
  15. "weight, "
  16. "size, "
  17. "antiflag, "
  18. "flag, "
  19. "wearflag, "
  20. "immuneflag, "
  21. "gold, "
  22. "shop_buy_price, "
  23. "refined_vnum, "
  24. "refine_set, "
  25. "magic_pct, "
  26. "limittype0, "
  27. "limitvalue0, "
  28. "limittype1, "
  29. "limitvalue1, "
  30. "applytype0, "
  31. "applyvalue0, "
  32. "applytype1, "
  33. "applyvalue1, "
  34. "applytype2, "
  35. "applyvalue2, "
  36. "applytype3, "
  37. "applyvalue3, "
  38. "value0, "
  39. "value1, "
  40. "value2, "
  41. "value3, "
  42. "value4, "
  43. "value5, "
  44. "specular, "
  45. "socket_pct, "
  46. "addon_type"
  47. ") "
  48. "values ("
  49. "%d, "
  50. "\"%s\", "
  51. "\"%s\", "
  52. "%d, "
  53. "%d, "
  54. "%d, "
  55. "%d, "
  56. "%d, "
  57. "%d, "
  58. "%d, "
  59. "%d, "
  60. "%lld, "
  61. "%lld, "
  62. "%d, "
  63. "%d, "
  64. "%d, "
  65. "%d, "
  66. "%ld, "
  67. "%d, "
  68. "%ld, "
  69. "%d, "
  70. "%ld, "
  71. "%d, "
  72. "%ld, "
  73. "%d, "
  74. "%ld, "
  75. "%d, "
  76. "%ld, "
  77. "%ld, "
  78. "%ld, "
  79. "%ld, "
  80. "%ld, "
  81. "%ld, "
  82. "%ld, "
  83. "%d, "
  84. "%d, "
  85. "%d"
  86. ")",
  87. GetTablePostfix(),
  88. t.dwVnum,
  89. t.szName,
  90. t.szLocaleName,
  91. t.bType,
  92. t.bSubType,
  93. t.bWeight,
  94. t.bSize,
  95. t.dwAntiFlags,
  96. t.dwFlags,
  97. t.dwWearFlags,
  98. t.dwImmuneFlag,
  99. t.dwGold,
  100. t.dwShopBuyPrice,
  101. t.dwRefinedVnum,
  102. t.wRefineSet,
  103. t.bAlterToMagicItemPct,
  104. t.aLimits[0].bType,
  105. t.aLimits[0].lValue,
  106. t.aLimits[1].bType,
  107. t.aLimits[1].lValue,
  108. t.aApplies[0].bType,
  109. t.aApplies[0].lValue,
  110. t.aApplies[1].bType,
  111. t.aApplies[1].lValue,
  112. t.aApplies[2].bType,
  113. t.aApplies[2].lValue,
  114. t.aApplies[3].bType,
  115. t.aApplies[3].lValue,
  116. t.alValues[0],
  117. t.alValues[1],
  118. t.alValues[2],
  119. t.alValues[3],
  120. t.alValues[4],
  121. t.alValues[5],
  122. t.bSpecular,
  123. t.bGainSocketPct,
  124. t.sAddonType
  125. );
  126. CDBManager::instance().AsyncQuery(query);
  127. }
  128. return true;
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement