Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetClientTurnManager.cpp
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | void CNetClientTurnManager::OnSyncError(u32 turn, const CStr& expectedHash, const std::vector<CSyncErrorMessage::S_m_PlayerNames>& playerNames) | ||||
LOGERROR("Out-Of-Sync on turn %d\nPlayers: %s\nDumping state to %s", turn, playerNamesString.str().c_str(), oosdumpPath.string8()); | LOGERROR("Out-Of-Sync on turn %d\nPlayers: %s\nDumping state to %s", turn, playerNamesString.str().c_str(), oosdumpPath.string8()); | ||||
const ScriptInterface& scriptInterface = m_NetClient.GetScriptInterface(); | const ScriptInterface& scriptInterface = m_NetClient.GetScriptInterface(); | ||||
JSContext* cx = scriptInterface.GetContext(); | JSContext* cx = scriptInterface.GetContext(); | ||||
JSAutoRequest rq(cx); | JSAutoRequest rq(cx); | ||||
JS::RootedValue msg(cx); | JS::RootedValue msg(cx); | ||||
scriptInterface.Eval("({ 'type':'out-of-sync' })", &msg); | |||||
Krinkle: What does the `L` signify here? | |||||
Not Done Inline ActionsIt's a 'literal' saying that the string should be treated as a wchar_t instead of a char_t. Sorta equivalent to saying it's UTF-16, not UTF-8. wraitii: It's a 'literal' saying that the string should be treated as a `wchar_t` instead of a `char_t`. | |||||
Done Inline Actionselexis: ( https://en.cppreference.com/w/cpp/language/string_literal ) | |||||
scriptInterface.SetProperty(msg, "turn", turn); | scriptInterface.CreateObject( | ||||
scriptInterface.SetProperty(msg, "players", playerNamesStrings); | &msg, | ||||
scriptInterface.SetProperty(msg, "expectedHash", expectedHashHex); | "type", std::wstring(L"out-of-sync"), | ||||
scriptInterface.SetProperty(msg, "hash", Hexify(hash)); | "turn", turn, | ||||
scriptInterface.SetProperty(msg, "path_oos_dump", wstring_from_utf8(oosdumpPath.string8())); | "players", playerNamesStrings, | ||||
scriptInterface.SetProperty(msg, "path_replay", wstring_from_utf8(m_Replay.GetDirectory().string8())); | "expectedHash", expectedHashHex, | ||||
"hash", Hexify(hash), | |||||
"path_oos_dump", wstring_from_utf8(oosdumpPath.string8()), | |||||
"path_replay", wstring_from_utf8(m_Replay.GetDirectory().string8())); | |||||
Done Inline ActionsCan be tested by starting with the host, modifying cost of a template and rejoin, works. elexis: Can be tested by starting with the host, modifying cost of a template and rejoin, works. | |||||
m_NetClient.PushGuiMessage(msg); | m_NetClient.PushGuiMessage(msg); | ||||
} | } |
Wildfire Games · Phabricator
What does the L signify here?