Batch #4203 by Yommy: 2 byte-identical, 13 confirmed by peer review. - fn_05609 EquipmentProperties::CEquipmentProperties2Dim::`scalar deleting destructor': logic confirmed by peer review - fn_05610 EquipmentProperties::CEquipmentProperties1Dim::`scalar deleting destructor': logic confirmed by peer review - fn_05924 CLuaInstance::GetFieldInt: logic confirmed by peer review - fn_05925 CLuaInstance::GetFieldUIntArray: logic confirmed by peer review - fn_05926 CLuaInstance::GetFieldString: logic confirmed by peer review - fn_05927 CLuaInstance::GetFieldStringArray: logic confirmed by peer review - fn_05928 CLuaInstance::GetFieldUIntMap: logic confirmed by peer review - fn_05929 CLuaInstance::GetFieldStringMap: logic confirmed by peer review - fn_05930 CLuaInstance::GetInt: logic confirmed by peer review - fn_06054 MessengerIntrusiveLink::Unlink6A6220: byte-identical - fn_06055 MessengerIntrusiveLink::Unlink6A6240: byte-identical - fn_21291 CGameMode::IsAllowedPair: logic confirmed by peer review - fn_21292 CGameMode::IsWithinRange: logic confirmed by peer review - fn_21293 CGameMode::IsRegisterCell: logic confirmed by peer review - fn_21294 CGameMode::HasUnknown01A4: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, youko, eAthena, willerthal Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#ifndef RAGNAROK_SOURCE_SCRIPT_LUAINSTANCE_H
|
|
#define RAGNAROK_SOURCE_SCRIPT_LUAINSTANCE_H
|
|
|
|
extern "C" {
|
|
#include <lua.h>
|
|
}
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class CLuaInstance {
|
|
public:
|
|
CLuaInstance();
|
|
virtual ~CLuaInstance();
|
|
bool Execute(const std::string& name);
|
|
bool LoadFile(const std::string& path);
|
|
bool LoadFile(const std::string& path, bool showError);
|
|
void SetGlobal(const std::string& name, bool value);
|
|
void SetGlobal(const std::string& name, lua_CFunction function);
|
|
void SetGlobal(const std::string& name, double value);
|
|
int ReadStrings(std::vector<std::string>& values, const char* global);
|
|
int GetFieldInt(int& value, const char* name);
|
|
int GetFieldUIntArray(std::vector<unsigned int>& values, const char* name);
|
|
int GetFieldString(std::string& value, const char* name);
|
|
int GetFieldStringArray(std::vector<std::string>& values, const char* name);
|
|
int GetFieldUIntMap(std::map<unsigned int, unsigned int>& values, const char* name);
|
|
int GetFieldStringMap(std::map<unsigned int, std::string>& values, const char* name);
|
|
int GetInt(int& value, int index);
|
|
lua_State* GetState() const { return this->m_state; }
|
|
|
|
protected:
|
|
/* 0004 */ lua_State* m_state;
|
|
|
|
private:
|
|
static int LuaMessageBox(lua_State* state);
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(CLuaInstance) == 8);
|
|
#endif
|
|
|
|
#endif
|