Jump to content
FapFap

LuaSQL - Nil Value | Working One

Recommended Posts

I opened this thread to ask what could be the problem that some GameServer accepts LuaSQL.dll and some doesn't..

Which addresses are edited?

"I tested on a Custom GS and on diff Custom One, one works fine other doesn't also it doesn't work on Lucky Files Clean GS.."

Share this post


Link to post
Share on other sites
3 hours ago, Satan said:

You must inject the .dll into gameserver.exe, otherwise will not work. Idk how to do that...

It was done, the console shows it has LuaSQL, yet his GS doesn’t register the function. With another GS it does work fine. I tried helping via TV and couldn’t get it to work. 

Share this post


Link to post
Share on other sites
9 hours ago, Satan said:

You must inject the .dll into gameserver.exe, otherwise will not work. Idk how to do that...

On 6/25/2016 at 9:44 AM, KONG said:

There are multiple ways of injecting a DLL.
There is the Codecave method which uses LoadLibrary&GetProcAddress,
but you can use programs like: CFF Explorer to eliminate the need to use those methods.
These tools requires a "dllexport" method, so in dllmain.cpp
the function: __declspec(dllexport) void __cdecl ExportedFunction() {}
is present so these tools can inject DLL. 

Screenshot_130.png

And to use the functions via LUA, I will ask @Wrexor to upload his documentation for using the interface
because I dont have it. Kudos to Miha for the picture hehe :)

 

EDIT: I just found this: maybe it'll work I havent tried. but it must be something like this


SQL_CONNECT = 'connect'
SQL_QUERY = 'query'
SQL_FETCH = 'fetch'
SQL_HOST = '127.0.0.1,3707'
SQL_UID = 'sa'
SQL_PWD = 'Y87dc#$98'

local connect, handle = LuaSQL(SQL_CONNECT, SQL_HOST, SQL_UID, SQL_PWD)
if(connect == 1) then
	print('Connection Established')
	local SqlText = "select * from accountserver.dbo.account_login where name = 'admin'"
	local query, stmt = LuaSQL(SQL_QUERY, handle, SqlText)
	
	if(query == 1) then
		print('Query success, fetching...')
		local row = LuaSQL(SQL_FETCH, handle, stmt)
		for i,v in pairs(row) do
			print(i..'=>'..v)
		end
	else
		print('Query Failed => '..query)
	end
else
	print('Connection Failed')
end

QueryAsyn(SQL_HOST, SQL_UID, SQL_PWD, 'UPDATE TradeDB.dbo.AccountInfo SET money = 99 WHERE accName = \'admin\'')

 

  • Like 1

Share this post


Link to post
Share on other sites

@V3ct0r We already tried but the Custom GS from you doesn't register the function

20 hours ago, Angelix said:

It was done, the console shows it has LuaSQL, yet his GS doesn’t register the function. With another GS it does work fine. I tried helping via TV and couldn’t get it to work. 

 

Edited by FapFap

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...