Permalink
Browse files

Merge branch 'master' into fast_lookup_fix

  • Loading branch information...
codenulls committed Dec 16, 2018
2 parents 120cafc + 3b154bc commit 37b8f81478471018e900a0b4a3249a09af347f8b
Showing with 8,514 additions and 3,146 deletions.
  1. +20 −13 .github/ISSUE_TEMPLATE/bug_report.md
  2. +4 −4 .github/ISSUE_TEMPLATE/feature_request.md
  3. 0 .github/ISSUE_TEMPLATE/{security-report.md → security_report.md}
  4. +28 −11 Client/cefweb/CWebCore.cpp
  5. +8 −6 Client/core/CConnectManager.cpp
  6. +66 −40 Client/core/CCore.cpp
  7. +7 −2 Client/core/CCore.h
  8. +1 −0 Client/core/CCredits.cpp
  9. +12 −5 Client/core/CGraphStats.cpp
  10. +1 −1 Client/core/CLocalization.cpp
  11. +8 −3 Client/core/CVersionUpdater.cpp
  12. +19 −0 Client/core/DXHook/CProxyDirect3DEffect.cpp
  13. +3 −0 Client/core/DXHook/CProxyDirect3DEffect.h
  14. +105 −123 Client/core/Graphics/CGraphics.cpp
  15. +29 −28 Client/core/Graphics/CGraphics.h
  16. +41 −29 Client/core/Graphics/CPrimitiveBatcher.cpp
  17. +14 −12 Client/core/Graphics/CPrimitiveBatcher.h
  18. +45 −31 Client/core/Graphics/CPrimitiveMaterialBatcher.cpp
  19. +15 −14 Client/core/Graphics/CPrimitiveMaterialBatcher.h
  20. +6 −6 Client/core/Graphics/CRenderItem.EffectCloner.cpp
  21. +1 −1 Client/core/Graphics/CRenderItem.EffectCloner.h
  22. +12 −10 Client/core/Graphics/CRenderItem.EffectTemplate.cpp
  23. +3 −3 Client/core/Graphics/CRenderItem.EffectTemplate.h
  24. +4 −4 Client/core/Graphics/CRenderItem.Shader.cpp
  25. +2 −2 Client/core/Graphics/CRenderItemManager.cpp
  26. +1 −1 Client/core/Graphics/CRenderItemManager.h
  27. +3 −1 Client/core/ServerBrowser/CServerBrowser.RemoteMasterServer.cpp
  28. +15 −0 Client/game_sa/CAESoundManagerSA.h
  29. +144 −0 Client/game_sa/CAnimBlendAssocGroupSA.h
  30. +15 −1 Client/game_sa/CAudioEngineSA.cpp
  31. +1 −1 Client/game_sa/CAudioEngineSA.h
  32. +5 −0 Client/game_sa/CCamSA.cpp
  33. +1 −0 Client/game_sa/CCamSA.h
  34. +2 −2 Client/game_sa/CGameSA.cpp
  35. +36 −17 Client/game_sa/CModelInfoSA.cpp
  36. +34 −18 Client/game_sa/CModelInfoSA.h
  37. +41 −3 Client/game_sa/CVehicleSA.cpp
  38. +2 −0 Client/game_sa/CVehicleSA.h
  39. +5 −0 Client/gui/CGUIComboBox_Impl.cpp
  40. +1 −0 Client/gui/CGUIComboBox_Impl.h
  41. +2 −2 Client/loader/Install.cpp
  42. +5 −5 Client/loader/MainFunctions.cpp
  43. +71 −72 Client/mods/deathmatch/CVoiceRecorder.cpp
  44. +4 −5 Client/mods/deathmatch/CVoiceRecorder.h
  45. +11 −2 Client/mods/deathmatch/ClientCommands.cpp
  46. +13 −0 Client/mods/deathmatch/logic/CClientCamera.cpp
  47. +1 −0 Client/mods/deathmatch/logic/CClientCamera.h
  48. +0 −9 Client/mods/deathmatch/logic/CClientColPolygon.cpp
  49. +0 −2 Client/mods/deathmatch/logic/CClientColPolygon.h
  50. +103 −27 Client/mods/deathmatch/logic/CClientGame.cpp
  51. +12 −9 Client/mods/deathmatch/logic/CClientGame.h
  52. +11 −0 Client/mods/deathmatch/logic/CClientObject.cpp
  53. +2 −0 Client/mods/deathmatch/logic/CClientObject.h
  54. +8 −11 Client/mods/deathmatch/logic/CClientPed.cpp
  55. +17 −24 Client/mods/deathmatch/logic/CClientPlayerVoice.cpp
  56. +2 −1 Client/mods/deathmatch/logic/CClientPlayerVoice.h
  57. +2 −2 Client/mods/deathmatch/logic/CClientRenderElementManager.cpp
  58. +1 −1 Client/mods/deathmatch/logic/CClientRenderElementManager.h
  59. +105 −3 Client/mods/deathmatch/logic/CClientVehicle.cpp
  60. +9 −0 Client/mods/deathmatch/logic/CClientVehicle.h
  61. +4 −0 Client/mods/deathmatch/logic/CPacketHandler.cpp
  62. +26 −4 Client/mods/deathmatch/logic/CRemoteCalls.cpp
  63. +3 −0 Client/mods/deathmatch/logic/CRemoteCalls.h
  64. +6 −2 Client/mods/deathmatch/logic/CResourceFileDownloadManager.cpp
  65. +0 −1 Client/mods/deathmatch/logic/CScriptFile.h
  66. +3 −1 Client/mods/deathmatch/logic/CSingularFileDownload.cpp
  67. +102 −9 Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
  68. +5 −0 Client/mods/deathmatch/logic/CStaticFunctionDefinitions.h
  69. +13 −36 Client/mods/deathmatch/logic/lua/CLuaArguments.cpp
  70. +17 −0 Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp
  71. +9 −0 Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.h
  72. +26 −24 Client/mods/deathmatch/logic/lua/CLuaManager.cpp
  73. +146 −142 Client/mods/deathmatch/logic/luadefs/CLuaDrawingDefs.cpp
  74. +71 −0 Client/mods/deathmatch/logic/luadefs/CLuaGUIDefs.cpp
  75. +3 −0 Client/mods/deathmatch/logic/luadefs/CLuaGUIDefs.h
  76. +54 −0 Client/mods/deathmatch/logic/luadefs/CLuaObjectDefs.cpp
  77. +2 −0 Client/mods/deathmatch/logic/luadefs/CLuaObjectDefs.h
  78. +203 −2 Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp
  79. +6 −0 Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h
  80. +70 −137 Client/multiplayer_sa/CMultiplayerSA.cpp
  81. +7 −0 Client/multiplayer_sa/CMultiplayerSA.h
  82. +2 −0 Client/multiplayer_sa/CMultiplayerSA_1.3.cpp
  83. +63 −112 Client/multiplayer_sa/CMultiplayerSA_CustomAnimations.cpp
  84. +58 −18 Client/multiplayer_sa/CMultiplayerSA_FixBadAnimId.cpp
  85. +66 −0 Client/multiplayer_sa/CMultiplayerSA_Peds.cpp
  86. +28 −0 Client/multiplayer_sa/CMultiplayerSA_Rendering.cpp
  87. +193 −0 Client/multiplayer_sa/CMultiplayerSA_VehicleCollision.cpp
  88. +91 −0 Client/multiplayer_sa/CMultiplayerSA_VehicleWeapons.cpp
  89. +3 −2 Client/multiplayer_sa/multiplayer_shotsync.cpp
  90. +3 −0 Client/sdk/core/CCoreInterface.h
  91. +12 −2 Client/sdk/core/CGraphicsInterface.h
  92. +3 −3 Client/sdk/core/CRenderItemManagerInterface.h
  93. +11 −1 Client/sdk/game/CAudioEngine.h
  94. +1 −0 Client/sdk/game/CCam.h
  95. +2 −0 Client/sdk/game/CModelInfo.h
  96. +6 −0 Client/sdk/game/CPed.h
  97. +2 −0 Client/sdk/game/CVehicle.h
  98. +18 −0 Client/sdk/game/Common.h
  99. +1 −0 Client/sdk/gui/CGUIComboBox.h
  100. +64 −40 Client/sdk/multiplayer/CMultiplayer.h
  101. +1 −1 Client/version.h
  102. +8 −8 Server/mods/deathmatch/logic/CBlip.cpp
  103. +4 −2 Server/mods/deathmatch/logic/CBlip.h
  104. +6 −12 Server/mods/deathmatch/logic/CBlipManager.cpp
  105. +1 −1 Server/mods/deathmatch/logic/CBlipManager.h
  106. +3 −3 Server/mods/deathmatch/logic/CColCircle.cpp
  107. +2 −2 Server/mods/deathmatch/logic/CColCircle.h
  108. +2 −3 Server/mods/deathmatch/logic/CColCuboid.cpp
  109. +2 −2 Server/mods/deathmatch/logic/CColCuboid.h
  110. +2 −2 Server/mods/deathmatch/logic/CColPolygon.cpp
  111. +2 −2 Server/mods/deathmatch/logic/CColPolygon.h
  112. +2 −3 Server/mods/deathmatch/logic/CColRectangle.cpp
  113. +2 −2 Server/mods/deathmatch/logic/CColRectangle.h
  114. +1 −1 Server/mods/deathmatch/logic/CColShape.cpp
  115. +1 −1 Server/mods/deathmatch/logic/CColShape.h
  116. +4 −4 Server/mods/deathmatch/logic/CColSphere.cpp
  117. +2 −2 Server/mods/deathmatch/logic/CColSphere.h
  118. +2 −3 Server/mods/deathmatch/logic/CColTube.cpp
  119. +2 −2 Server/mods/deathmatch/logic/CColTube.h
  120. +1 −2 Server/mods/deathmatch/logic/CConsole.cpp
  121. +1 −1 Server/mods/deathmatch/logic/CConsoleClient.cpp
  122. +3 −1 Server/mods/deathmatch/logic/CConsoleClient.h
  123. +2 −2 Server/mods/deathmatch/logic/CCustomWeapon.cpp
  124. +1 −1 Server/mods/deathmatch/logic/CCustomWeapon.h
  125. +36 −9 Server/mods/deathmatch/logic/CDatabaseManager.cpp
  126. +3 −1 Server/mods/deathmatch/logic/CDatabaseManager.h
  127. +2 −2 Server/mods/deathmatch/logic/CDummy.cpp
  128. +4 −2 Server/mods/deathmatch/logic/CDummy.h
  129. +18 −48 Server/mods/deathmatch/logic/CElement.cpp
  130. +4 −8 Server/mods/deathmatch/logic/CElement.h
  131. +5 −0 Server/mods/deathmatch/logic/CGame.cpp
  132. +8 −7 Server/mods/deathmatch/logic/CGroups.cpp
  133. +1 −1 Server/mods/deathmatch/logic/CMapManager.cpp
  134. +12 −10 Server/mods/deathmatch/logic/CMarker.cpp
  135. +4 −2 Server/mods/deathmatch/logic/CMarker.h
  136. +6 −12 Server/mods/deathmatch/logic/CMarkerManager.cpp
  137. +1 −1 Server/mods/deathmatch/logic/CMarkerManager.h
  138. +8 −9 Server/mods/deathmatch/logic/CObject.cpp
  139. +4 −2 Server/mods/deathmatch/logic/CObject.h
  140. +6 −12 Server/mods/deathmatch/logic/CObjectManager.cpp
  141. +1 −1 Server/mods/deathmatch/logic/CObjectManager.h
  142. +10 −8 Server/mods/deathmatch/logic/CPed.cpp
  143. +4 −2 Server/mods/deathmatch/logic/CPed.h
  144. +6 −12 Server/mods/deathmatch/logic/CPedManager.cpp
  145. +1 −1 Server/mods/deathmatch/logic/CPedManager.h
  146. +1 −1 Server/mods/deathmatch/logic/CPerPlayerEntity.cpp
  147. +1 −1 Server/mods/deathmatch/logic/CPerPlayerEntity.h
  148. +10 −10 Server/mods/deathmatch/logic/CPickup.cpp
  149. +4 −2 Server/mods/deathmatch/logic/CPickup.h
  150. +5 −11 Server/mods/deathmatch/logic/CPickupManager.cpp
  151. +2 −1 Server/mods/deathmatch/logic/CPlayer.cpp
  152. +7 −1 Server/mods/deathmatch/logic/CPlayer.h
  153. +10 −8 Server/mods/deathmatch/logic/CRadarArea.cpp
  154. +4 −3 Server/mods/deathmatch/logic/CRadarArea.h
  155. +6 −12 Server/mods/deathmatch/logic/CRadarAreaManager.cpp
  156. +1 −1 Server/mods/deathmatch/logic/CRadarAreaManager.h
  157. +25 −3 Server/mods/deathmatch/logic/CRemoteCalls.cpp
  158. +3 −0 Server/mods/deathmatch/logic/CRemoteCalls.h
  159. +9 −4 Server/mods/deathmatch/logic/CResource.cpp
  160. +2 −1 Server/mods/deathmatch/logic/CResourceChecker.Data.h
  161. +0 −5 Server/mods/deathmatch/logic/CResourceChecker.cpp
  162. +141 −228 Server/mods/deathmatch/logic/CResourceMapItem.cpp
  163. +50 −53 Server/mods/deathmatch/logic/CResourceMapItem.h
  164. +4 −2 Server/mods/deathmatch/logic/CScriptFile.h
  165. +124 −104 Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
  166. +5 −6 Server/mods/deathmatch/logic/CTeam.cpp
  167. +4 −2 Server/mods/deathmatch/logic/CTeam.h
  168. +6 −12 Server/mods/deathmatch/logic/CTeamManager.cpp
  169. +1 −1 Server/mods/deathmatch/logic/CTeamManager.h
  170. +10 −10 Server/mods/deathmatch/logic/CVehicle.cpp
  171. +4 −3 Server/mods/deathmatch/logic/CVehicle.h
  172. +6 −13 Server/mods/deathmatch/logic/CVehicleManager.cpp
  173. +1 −1 Server/mods/deathmatch/logic/CVehicleManager.h
  174. +6 −6 Server/mods/deathmatch/logic/CWater.cpp
  175. +4 −2 Server/mods/deathmatch/logic/CWater.h
  176. +10 −6 Server/mods/deathmatch/logic/CWaterManager.cpp
  177. +1 −1 Server/mods/deathmatch/logic/CWaterManager.h
  178. +9 −0 Server/mods/deathmatch/logic/Utils.cpp
  179. +12 −9 Server/mods/deathmatch/logic/lua/CLuaArgument.cpp
  180. +1 −1 Server/mods/deathmatch/logic/lua/CLuaArgument.h
  181. +22 −36 Server/mods/deathmatch/logic/lua/CLuaArguments.cpp
  182. +1 −1 Server/mods/deathmatch/logic/lua/CLuaArguments.h
  183. +1 −1 Server/mods/deathmatch/logic/packets/CCustomDataPacket.cpp
  184. +2 −1 Server/mods/deathmatch/logic/packets/CLuaEventPacket.cpp
  185. +5 −2 Server/mods/deathmatch/utils/CHqComms.h
  186. +8 −5 Server/mods/deathmatch/utils/CMasterServerAnnouncer.h
  187. +4 −1 Server/mods/deathmatch/utils/COpenPortsTester.h
  188. +1 −1 Server/version.h
  189. +1 −1 Shared/XML/CXMLFileImpl.cpp
  190. BIN Shared/data/MTA San Andreas/MTA/bass.dll
  191. BIN Shared/data/MTA San Andreas/MTA/bass_fx.dll
  192. BIN Shared/data/MTA San Andreas/MTA/bassmidi.dll
  193. BIN Shared/data/MTA San Andreas/MTA/bassmix.dll
  194. BIN Shared/data/MTA San Andreas/MTA/bassopus.dll
  195. BIN Shared/data/MTA San Andreas/MTA/basswma.dll
  196. +493 −466 Shared/data/MTA San Andreas/MTA/locale/ar/client.po
  197. +4 −4 Shared/data/MTA San Andreas/MTA/locale/el/client.po
  198. +135 −125 Shared/data/MTA San Andreas/MTA/locale/es/client.po
  199. +4 −5 Shared/data/MTA San Andreas/MTA/locale/hr/client.po
  200. +5 −4 Shared/data/MTA San Andreas/MTA/locale/id/client.po
  201. +309 −311 Shared/data/MTA San Andreas/MTA/locale/ja/client.po
  202. +63 −55 Shared/data/MTA San Andreas/MTA/locale/lt/client.po
  203. +13 −12 Shared/data/MTA San Andreas/MTA/locale/mk/client.po
  204. +9 −9 Shared/data/MTA San Andreas/MTA/locale/nl/client.po
  205. +4 −3 Shared/data/MTA San Andreas/MTA/locale/pl/client.po
  206. +3 −3 Shared/data/MTA San Andreas/MTA/locale/pt_BR/client.po
  207. +11 −5 Shared/data/MTA San Andreas/MTA/locale/ru/client.po
  208. BIN Shared/data/MTA San Andreas/MTA/locale/sk/menu_about.png
  209. BIN Shared/data/MTA San Andreas/MTA/locale/sk/menu_browse_servers.png
  210. BIN Shared/data/MTA San Andreas/MTA/locale/sk/menu_quick_connect.png
  211. BIN Shared/data/MTA San Andreas/MTA/locale/sk/menu_settings.png
  212. +192 −147 Shared/data/MTA San Andreas/MTA/locale/sv/client.po
  213. +17 −10 Shared/data/MTA San Andreas/MTA/locale/tr/client.po
  214. +12 −6 Shared/data/MTA San Andreas/MTA/locale/uk/client.po
  215. +3,208 −0 Shared/data/MTA San Andreas/MTA/locale/vi/client.po
  216. BIN Shared/data/MTA San Andreas/MTA/locale/vi/flag.png
  217. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_about.png
  218. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_browse_servers.png
  219. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_disconnect.png
  220. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_host_game.png
  221. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_map_editor.png
  222. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_quick_connect.png
  223. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_quit.png
  224. BIN Shared/data/MTA San Andreas/MTA/locale/vi/menu_settings.png
  225. +3 −3 Shared/data/MTA San Andreas/MTA/locale/zh_CN/client.po
  226. +47 −42 Shared/installer/locale/es.po
  227. +9 −7 Shared/installer/locale/ja.po
  228. +9 −5 Shared/installer/locale/lt.po
  229. +500 −0 Shared/installer/locale/vi.po
  230. +1 −1 Shared/mods/deathmatch/logic/CScriptDebugging.cpp
  231. +7 −5 Shared/mods/deathmatch/logic/luadefs/CLuaFileDefs.cpp
  232. +84 −3 Shared/sdk/CMatrix.h
  233. +1 −1 Shared/sdk/CScriptArgReader.h
  234. +9 −0 Shared/sdk/CVector.h
  235. +32 −0 Shared/sdk/SharedUtil.Time.h
  236. +1 −0 Shared/sdk/SharedUtil.h
  237. +28 −8 Shared/sdk/net/CNetHTTPDownloadManagerInterface.h
  238. BIN clang-format-r325576.exe
  239. BIN fnr.exe
  240. +1 −1 premake5.lua
  241. +1 −1 utils/buildactions/install_cef.lua
  242. +2 −2 utils/pull_pootle_catalogs_main.bat
  243. +1 −1 utils/pull_pootle_menu_pics_main.bat
  244. +2 −0 vendor/bass/bass.h
  245. +3 −1 vendor/bass/basswma.h
  246. +4 −4 vendor/cef3/premake5.lua
  247. +7 −4 vendor/tinygettext/dirent_win32.h
  248. +1 −1 vendor/tinygettext/unix_file_system.cpp
  249. +2 −2 win-create-projects.bat
@@ -5,28 +5,35 @@ about: Create a report to help us improve
---

**Describe the bug**
A clear and concise description of what the bug is.
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:
**To reproduce**
<!--
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
Please paste reproduction resources (zip files) directly into this section.
-->

**Expected behaviour**
<!-- A clear and concise description of what you expected to happen. -->

**Screenshots**
<!--
If applicable, add screenshots to help explain your problem.
Please paste screenshots directly into this section. Do not provide imgur/tinypic/photobucket links.
-->

**MTA Client (please complete the following information):**
- Version [e.g. 1.1, 1.5.4]
- Running in Wine? [e.g, No, Yes - Linux, Yes - macOS]

**MTA Server (please complete the following information):**
- OS: [e.g. Windows 7, Debian Stretch]
- Version [e.g. 1.1, 1.5.4]
**Version**
<!--
Please provide the following information:
- server/client version (e.g, 1.1, 1.5.4)
- if you are running Wine, please say so, and say if Linux or macOS
- what operating system the server is running on, if relevant
-->

**Additional context**
Add any other context about the problem here
<!-- Add any other context about the problem here -->
@@ -5,13 +5,13 @@ about: Suggest an idea for this project
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
Add any other context or screenshots about the feature request here.
<!-- Add any other context or screenshots about the feature request here. -->
@@ -127,12 +127,24 @@ void CWebCore::DoPulse()

CWebView* CWebCore::FindWebView(CefRefPtr<CefBrowser> browser)
{
if (!browser)
return nullptr;

for (auto pWebView : m_WebViews)
{
if (!pWebView)
continue;

CefRefPtr<CefBrowser> pBrowser = pWebView->GetCefBrowser();

if (!pBrowser)
continue;

// CefBrowser objects are not unique
if (pWebView->GetCefBrowser()->GetIdentifier() == browser->GetIdentifier())
if (pBrowser->GetIdentifier() == browser->GetIdentifier())
return pWebView.get();
}

return nullptr;
}

@@ -168,16 +180,17 @@ void CWebCore::RemoveWebViewEvents(CWebView* pWebView)

void CWebCore::DoEventQueuePulse()
{
std::lock_guard<std::mutex> lock(m_EventQueueMutex);
std::list<EventEntry> eventQueue;
{
std::lock_guard<std::mutex> lock(m_EventQueueMutex);
std::swap(eventQueue, m_EventQueue);
}

for (auto& event : m_EventQueue)
for (auto& event : eventQueue)
{
event.callback();
}

// Clear message queue
m_EventQueue.clear();

// Invoke paint method if necessary on the main thread
for (auto& view : m_WebViews)
{
@@ -490,9 +503,11 @@ bool CWebCore::UpdateListsFromMaster()
#ifdef MTA_DEBUG
OutputDebugLine("Updating white- and blacklist...");
#endif
SHttpRequestOptions options;
options.uiConnectionAttempts = 3;
g_pCore->GetNetwork()
->GetHTTPDownloadManager(EDownloadModeType::WEBBROWSER_LISTS)
->QueueFile(SString("%s?type=getrev", BROWSER_UPDATE_URL), NULL, NULL, 0, false, this, &CWebCore::StaticFetchRevisionFinished, false, 3);
->QueueFile(SString("%s?type=getrev", BROWSER_UPDATE_URL), NULL, this, &CWebCore::StaticFetchRevisionFinished, options);

pLastUpdateNode->SetTagContent(SString("%d", (long long)currentTime));
m_pXmlConfig->Write();
@@ -686,20 +701,22 @@ void CWebCore::StaticFetchRevisionFinished(const SHttpDownloadResult& result)
int iWhiteListRevision = atoi(strWhiteRevision);
if (iWhiteListRevision > pWebCore->m_iWhitelistRevision)
{
SHttpRequestOptions options;
options.uiConnectionAttempts = 3;
g_pCore->GetNetwork()
->GetHTTPDownloadManager(EDownloadModeType::WEBBROWSER_LISTS)
->QueueFile(SString("%s?type=fetchwhite", BROWSER_UPDATE_URL), NULL, NULL, 0, false, pWebCore, &CWebCore::StaticFetchWhitelistFinished,
false, 3);
->QueueFile(SString("%s?type=fetchwhite", BROWSER_UPDATE_URL), NULL, pWebCore, &CWebCore::StaticFetchWhitelistFinished, options);

pWebCore->m_iWhitelistRevision = iWhiteListRevision;
}
int iBlackListRevision = atoi(strBlackRevision);
if (iBlackListRevision > pWebCore->m_iBlacklistRevision)
{
SHttpRequestOptions options;
options.uiConnectionAttempts = 3;
g_pCore->GetNetwork()
->GetHTTPDownloadManager(EDownloadModeType::WEBBROWSER_LISTS)
->QueueFile(SString("%s?type=fetchblack", BROWSER_UPDATE_URL), NULL, NULL, 0, false, pWebCore, &CWebCore::StaticFetchBlacklistFinished,
false, 3);
->QueueFile(SString("%s?type=fetchblack", BROWSER_UPDATE_URL), NULL, pWebCore, &CWebCore::StaticFetchBlacklistFinished, options);

pWebCore->m_iBlacklistRevision = iBlackListRevision;
}
@@ -479,17 +479,19 @@ void CConnectManager::OpenServerFirewall(in_addr Address, ushort usHttpPort, boo
if (usHttpPort)
{
// Send to server http port if known
SHttpRequestOptions options;
options.uiConnectionAttempts = 1;
options.uiConnectTimeoutMs = uiTimeOut;
SString strDummyUrl("http://%s:%d/mta_client_firewall_probe/", inet_ntoa(Address), usHttpPort);
g_pCore->GetNetwork()
->GetHTTPDownloadManager(EDownloadMode::CONNECT_TCP_SEND)
->QueueFile(strDummyUrl, NULL, "", 0, true, NULL, NULL, false, 1, uiTimeOut);
g_pCore->GetNetwork()->GetHTTPDownloadManager(EDownloadMode::CONNECT_TCP_SEND)->QueueFile(strDummyUrl, NULL, NULL, NULL, options);
}
if (usHttpPort == 0 || bHighPriority)
{
// Send to standard http port
SHttpRequestOptions options;
options.uiConnectionAttempts = 1;
options.uiConnectTimeoutMs = uiTimeOut;
SString strDummyUrl("http://%s/mta_client_firewall_probe/", inet_ntoa(Address));
g_pCore->GetNetwork()
->GetHTTPDownloadManager(EDownloadMode::CONNECT_TCP_SEND)
->QueueFile(strDummyUrl, NULL, "", 0, true, NULL, NULL, false, 1, uiTimeOut);
g_pCore->GetNetwork()->GetHTTPDownloadManager(EDownloadMode::CONNECT_TCP_SEND)->QueueFile(strDummyUrl, NULL, NULL, NULL, options);
}
}
@@ -1014,6 +1014,9 @@ void CCore::CreateNetwork()
ulong ulNetModuleVersion = 0;
pfnCheckCompatibility(1, &ulNetModuleVersion);
SString strMessage("Network module not compatible! (Expected 0x%x, got 0x%x)", MTA_DM_CLIENT_NET_MODULE_VERSION, ulNetModuleVersion);
#if !defined(MTA_DM_CONNECT_TO_PUBLIC)
strMessage += "\n\n(Devs: Update source and run win-install-data.bat)";
#endif
BrowseToSolution("netc-not-compatible", ASK_GO_ONLINE | TERMINATE_PROCESS, strMessage);
}

@@ -1364,7 +1367,7 @@ void CCore::RegisterCommands()
m_pCommands->Add("showframegraph", _("shows the frame timing graph"), CCommandFuncs::ShowFrameGraph);
m_pCommands->Add("jinglebells", "", CCommandFuncs::JingleBells);
m_pCommands->Add("fakelag", "", CCommandFuncs::FakeLag);

m_pCommands->Add("reloadnews", "for developers: reload news", CCommandFuncs::ReloadNews);
}

@@ -1715,6 +1718,14 @@ void CCore::UpdateRecentlyPlayed()
CCore::GetSingleton().SaveConfig();
}

//
// Called just before GTA calculates frame time deltas
//
void CCore::OnGameTimerUpdate()
{
ApplyQueuedFrameRateLimit();
}

//
// Recalculate FPS limit to use
//
@@ -1790,55 +1801,47 @@ void CCore::ApplyFrameRateLimit(uint uiOverrideRate)

uint uiUseRate = uiOverrideRate != -1 ? uiOverrideRate : m_uiFrameRateLimit;

TIMING_GRAPH("Limiter");

if (uiUseRate < 1)
return DoReliablePulse();

if (m_DiagnosticDebug != EDiagnosticDebug::D3D_6732)
Sleep(1); // Make frame rate smoother maybe

// Calc required time in ms between frames
const double dTargetTimeToUse = 1000.0 / uiUseRate;

// Time now
double dTimeMs = GetTickCount32();

// Get delta time in ms since last frame
double dTimeUsed = dTimeMs - m_dLastTimeMs;

// Apply any over/underrun carried over from the previous frame
dTimeUsed += m_dPrevOverrun;

if (dTimeUsed < dTargetTimeToUse)
if (uiUseRate > 0)
{
// Have time spare - maybe eat some of that now
double dSpare = dTargetTimeToUse - dTimeUsed;

double dUseUpNow = dSpare - dTargetTimeToUse * 0.2f;
if (dUseUpNow >= 1)
Sleep(static_cast<DWORD>(floor(dUseUpNow)));
// Apply previous frame rate if is hasn't been done yet
ApplyQueuedFrameRateLimit();

// Redo timing calcs
dTimeMs = GetTickCount32();
dTimeUsed = dTimeMs - m_dLastTimeMs;
dTimeUsed += m_dPrevOverrun;
// Limit is usually applied in OnGameTimerUpdate
m_uiQueuedFrameRate = uiUseRate;
m_bQueuedFrameRateValid = true;
}

// Update over/underrun for next frame
m_dPrevOverrun = dTimeUsed - dTargetTimeToUse;

// Limit carry over
m_dPrevOverrun = Clamp(dTargetTimeToUse * -0.9f, m_dPrevOverrun, dTargetTimeToUse * 0.1f);

m_dLastTimeMs = dTimeMs;

DoReliablePulse();

TIMING_GRAPH("FrameEnd");
TIMING_GRAPH("");
}

//
// Frame rate limit (wait) is done here.
//
void CCore::ApplyQueuedFrameRateLimit()
{
if (m_bQueuedFrameRateValid)
{
m_bQueuedFrameRateValid = false;
// Calc required time in ms between frames
const double dTargetTimeToUse = 1000.0 / m_uiQueuedFrameRate;

while (true)
{
// See if we need to wait
double dSpare = dTargetTimeToUse - m_FrameRateTimer.Get();
if (dSpare <= 0.0)
break;
if (dSpare >= 2.0)
Sleep(1);
}
m_FrameRateTimer.Reset();
TIMING_GRAPH("Limiter");
}
}

//
// DoReliablePulse
//
@@ -2270,3 +2273,26 @@ SString CCore::GetBlueCopyrightString(void)
SString strCopyright = BLUE_COPYRIGHT_STRING;
return strCopyright.Replace("%BUILD_YEAR%", std::to_string(BUILD_YEAR).c_str());
}

bool CCore::IsHostSmotraServer()
{
unsigned int uiPort;
SString strHost;
CVARS_GET("host", strHost);
CVARS_GET("port", uiPort);

if (uiPort != 22003)
{
return false;
}

unsigned int arrSmotraHostIps[3] = {HashString("164.132.204.62"), HashString("149.202.223.26"), HashString("151.80.111.167")};
for (int i = 0; i < 3; i++)
{
if (arrSmotraHostIps[i] == HashString(strHost))
{
return true;
}
}
return false;
}
@@ -124,6 +124,7 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
void EnableChatInput(char* szCommand, DWORD dwColor);
bool IsChatInputEnabled(void);
bool ClearChat();
void OnGameTimerUpdate(void);

// Screenshots
void TakeScreenShot(void);
@@ -213,6 +214,7 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
uint GetFrameRateLimit(void) { return m_uiFrameRateLimit; }
void RecalculateFrameRateLimit(uint uiServerFrameRateLimit = -1, bool bLogToConsole = true);
void ApplyFrameRateLimit(uint uiOverrideRate = -1);
void ApplyQueuedFrameRateLimit(void);
void EnsureFrameRateLimitApplied(void);
void SetClientScriptFrameRateLimit(uint uiClientScriptFrameRateLimit);
void DoReliablePulse(void);
@@ -274,6 +276,8 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
bool IsFakeLagCommandEnabled(void) { return m_bFakeLagCommandEnabled; }
SString GetBlueCopyrightString(void);

bool IsHostSmotraServer();

private:
// Core devices.
CXML* m_pXML;
@@ -346,8 +350,9 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
uint m_uiServerFrameRateLimit;
uint m_uiClientScriptFrameRateLimit;
uint m_uiFrameRateLimit;
double m_dLastTimeMs;
double m_dPrevOverrun;
CElapsedTimeHD m_FrameRateTimer;
uint m_uiQueuedFrameRate;
bool m_bQueuedFrameRateValid;
bool m_bWaitToSetNick;
uint m_uiNewNickWaitFrames;
EDiagnosticDebugType m_DiagnosticDebug;
@@ -158,6 +158,7 @@ CCredits::CCredits(void)
"FileEX\n"
"Pirulax\n"
"SDraw\n"
"samr46\n"
"\n"
"\n";

Oops, something went wrong.

0 comments on commit 37b8f81

Please sign in to comment.