Skip to content

Commit

Permalink
Merge tag 'dev/16.2.7-dev.1' into rc
Browse files Browse the repository at this point in the history
  • Loading branch information
vadzz-dev committed Sep 13, 2024
2 parents dbb37b8 + 9c8caa9 commit 38ecccf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
12 changes: 12 additions & 0 deletions client/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,15 @@ ALTV_JS_EXPORT const char* GetSDKHash()
{
return ALT_SDK_VERSION;
}

#ifndef ALTV_JS_SHARED
namespace alt
{
v8::Platform* GetV8Platform();
}

v8::Platform* alt::GetV8Platform()
{
return CV8ScriptRuntime::Instance().GetPlatform();
}
#endif
12 changes: 7 additions & 5 deletions shared/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

Log& Log::Endl(Log& log)
{
auto& core = alt::ICore::Instance();

v8::Isolate* isolate = nullptr;
#ifdef ALT_CLIENT_API
isolate = CV8ScriptRuntime::Instance().GetIsolate();
Expand All @@ -22,11 +24,11 @@ Log& Log::Endl(Log& log)

switch(log.type)
{
case INFO: alt::ICore::Instance().LogInfo(log.buf.str(), resource); break;
case DEBUG: alt::ICore::Instance().LogDebug(log.buf.str().c_str(), resource); break;
case WARNING: alt::ICore::Instance().LogWarning(log.buf.str().c_str(), resource); break;
case ERR: alt::ICore::Instance().LogError(log.buf.str().c_str(), resource); break;
case COLORED: alt::ICore::Instance().LogColored(log.buf.str().c_str(), resource); break;
case INFO: core.LogInfo(LOG_PREFIX, log.buf.str(), resource); break;
case DEBUG: core.LogDebug(LOG_PREFIX, log.buf.str().c_str(), resource); break;
case WARNING: core.LogWarning(LOG_PREFIX, log.buf.str().c_str(), resource); break;
case ERR: core.LogError(LOG_PREFIX, log.buf.str().c_str(), resource); break;
case COLORED: core.LogColored(LOG_PREFIX, log.buf.str().c_str(), resource); break;
}

log.buf.str("");
Expand Down
2 changes: 2 additions & 0 deletions shared/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class Log
Log() = default;

public:
static constexpr const char* LOG_PREFIX = "[js]";

Log(const Log&) = delete;
Log(Log&&) = delete;
Log& operator=(const Log&) = delete;
Expand Down
6 changes: 3 additions & 3 deletions shared/V8ResourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,17 +661,17 @@ static void PrintLog(const v8::FunctionCallbackInfo<v8::Value>& info)
{
case 0:
{
alt::ICore::Instance().LogColored(stream.str(), resource->GetResource());
alt::ICore::Instance().LogColored(Log::LOG_PREFIX, stream.str(), resource->GetResource());
break;
}
case 1:
{
alt::ICore::Instance().LogWarning(stream.str(), resource->GetResource());
alt::ICore::Instance().LogWarning(Log::LOG_PREFIX, stream.str(), resource->GetResource());
break;
}
case 2:
{
alt::ICore::Instance().LogError(stream.str(), resource->GetResource());
alt::ICore::Instance().LogError(Log::LOG_PREFIX, stream.str(), resource->GetResource());
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion shared/deps/cpp-sdk
Submodule cpp-sdk updated 2 files
+5 −5 ICore.h
+6 −1 objects/IEntity.h

0 comments on commit 38ecccf

Please sign in to comment.