Ability to get buffer from inputmessage
This commit is contained in:
parent
07e40afa3d
commit
d20c263912
|
@ -777,7 +777,7 @@ void Application::registerLuaFunctions()
|
||||||
g_lua.registerClass<InputMessage>();
|
g_lua.registerClass<InputMessage>();
|
||||||
g_lua.bindClassStaticFunction<InputMessage>("create", []{ return InputMessagePtr(new InputMessage); });
|
g_lua.bindClassStaticFunction<InputMessage>("create", []{ return InputMessagePtr(new InputMessage); });
|
||||||
g_lua.bindClassMemberFunction<InputMessage>("setBuffer", &InputMessage::setBuffer);
|
g_lua.bindClassMemberFunction<InputMessage>("setBuffer", &InputMessage::setBuffer);
|
||||||
g_lua.bindClassMemberFunction<InputMessage>("getBuffer", &InputMessage::getBuffer);
|
g_lua.bindClassMemberFunction<InputMessage>("getBuffer", &InputMessage::getBuffer);
|
||||||
g_lua.bindClassMemberFunction<InputMessage>("skipBytes", &InputMessage::skipBytes);
|
g_lua.bindClassMemberFunction<InputMessage>("skipBytes", &InputMessage::skipBytes);
|
||||||
g_lua.bindClassMemberFunction<InputMessage>("getU8", &InputMessage::getU8);
|
g_lua.bindClassMemberFunction<InputMessage>("getU8", &InputMessage::getU8);
|
||||||
g_lua.bindClassMemberFunction<InputMessage>("getU16", &InputMessage::getU16);
|
g_lua.bindClassMemberFunction<InputMessage>("getU16", &InputMessage::getU16);
|
||||||
|
|
|
@ -37,8 +37,8 @@ public:
|
||||||
|
|
||||||
InputMessage();
|
InputMessage();
|
||||||
|
|
||||||
void setBuffer(const std::string& buffer);
|
void setBuffer(const std::string& buffer);
|
||||||
std::string getBuffer() { return std::string((char*)m_buffer + m_headerPos, m_messageSize); }
|
std::string getBuffer() { return std::string((char*)m_buffer + m_headerPos, m_messageSize); }
|
||||||
|
|
||||||
void skipBytes(uint16 bytes) { m_readPos += bytes; }
|
void skipBytes(uint16 bytes) { m_readPos += bytes; }
|
||||||
void setReadPos(uint16 readPos) { m_readPos = readPos; }
|
void setReadPos(uint16 readPos) { m_readPos = readPos; }
|
||||||
|
|
Loading…
Reference in New Issue