This commit is contained in:
watrabi
2025-12-18 16:59:29 -05:00
parent c93494f795
commit ff95483b22
54 changed files with 60469 additions and 509 deletions
+21 -21
View File
@@ -11,17 +11,17 @@
#define LUAVM_DESERIALIZER
#include "LuaSerializer.inl"
struct CoreScriptBytecode
{
const char* name;
const unsigned char* value;
size_t dataSize;
struct CoreScriptBytecode
{
const char* name;
const unsigned char* value;
size_t dataSize;
};
#include "LuaGenCS.inl"
// Dummy implementation of Lua parser (referenced by Lua sources)
Proto *luaY_parser(lua_State *L, ZIO *z, Mbuffer *buff, const char *name)
Proto* luaY_parser(lua_State* L, ZIO* z, Mbuffer* buff, const char* name)
{
lua_pushstring(L, "");
luaD_throw(L, LUA_ERRSYNTAX);
@@ -52,7 +52,7 @@ namespace LuaVM
return LuaDeserializer::deserializeFailure(L, chunkname);
}
}
unsigned int getKey()
{
// This is an initial value, it will be corrected by the server via SET_GLOBALS packet
@@ -85,35 +85,35 @@ namespace LuaVM
return false;
}
std::string getBytecodeCore(const std::string& name)
std::string getBytecodeCore(const std::string& name)
{
std::string rotName = RBX::rot13(name);
for (int i = 0; i < sizeof(gCoreScripts)/sizeof(gCoreScripts[0]); i++)
for (int i = 0; i < sizeof(gCoreScripts) / sizeof(gCoreScripts[0]); i++)
if (gCoreScripts[i].name == rotName)
return std::string(reinterpret_cast<const char*>(gCoreScripts[i].value), gCoreScripts[i].dataSize);
return "";
}
boost::unordered_map<std::string, std::string> getBytecodeCoreModules()
{
boost::unordered_map<std::string, std::string> coreModuleScripts;
boost::unordered_map<std::string, std::string> getBytecodeCoreModules()
{
boost::unordered_map<std::string, std::string> coreModuleScripts;
for (int i = 0; i < sizeof(gCoreModuleScripts)/sizeof(gCoreModuleScripts[0]); i++)
{
coreModuleScripts[gCoreModuleScripts[i].name] = std::string(reinterpret_cast<const char*>(gCoreModuleScripts[i].value), gCoreModuleScripts[i].dataSize);
}
for (int i = 0; i < sizeof(gCoreModuleScripts) / sizeof(gCoreModuleScripts[0]); i++)
{
coreModuleScripts[gCoreModuleScripts[i].name] = std::string(reinterpret_cast<const char*>(gCoreModuleScripts[i].value), gCoreModuleScripts[i].dataSize);
}
return coreModuleScripts;
}
return coreModuleScripts;
}
unsigned int rbxOldEncode(unsigned int i, int pc, unsigned int key)
{
return i;
}
}
unsigned int rbxDaxEncode(unsigned int i, int pc, unsigned int key)
unsigned int rbxDaxEncode(unsigned int i, int pc, unsigned int key)
{
return i;
}
}
}