Showcase your libraries, tools and other projects that help your fellow love users.
ivan
Party member
Posts: 1915 Joined: Fri Mar 07, 2008 1:39 pm
Contact:
Post
by ivan » Tue Dec 17, 2019 8:47 am
This is a cross-platform LuaJIT/FFI wrapper for Steamworks. The library provides easy and simple Steamworks integration, using the original redistributable binaries provided by Valve.
https://github.com/2dengine/sworks-ffi
This project has been retired as of August 3, 2022
Last edited by
ivan on Wed Aug 03, 2022 8:13 pm, edited 5 times in total.
grump
Party member
Posts: 947 Joined: Sat Jul 22, 2017 7:43 pm
Post
by grump » Tue Dec 17, 2019 10:45 am
Code: Select all
ffi.C.strtoull("0xffffffffffffffff", nil, 16)
LuaJIT accepts a ULL suffix for this.
raidho36
Party member
Posts: 2063 Joined: Mon Jun 17, 2013 12:00 pm
Post
by raidho36 » Tue Dec 17, 2019 1:36 pm
Yeah, I mean, it's LuaJIT-exclusive anyway, you can't make this work in regular Lua.
ivan
Party member
Posts: 1915 Joined: Fri Mar 07, 2008 1:39 pm
Contact:
Post
by ivan » Tue Dec 17, 2019 2:35 pm
Thanks grump, I will add that change although I have tested it and it works fine with either:
Code: Select all
a = ffi.C.strtoull("0xffffffffffffffff", nil, 16)
b = ffi.C.strtoull("0xffffffffffffffffULL", nil, 16)
assert(a == b)
In general, pure Lua can't handle such large numbers:
grump
Party member
Posts: 947 Joined: Sat Jul 22, 2017 7:43 pm
Post
by grump » Tue Dec 17, 2019 2:41 pm
ivan wrote: ↑ Tue Dec 17, 2019 2:35 pm
In general, pure Lua can't handle such large numbers:
The point is that you can use the ULL suffix to write 64 bit integer literals directly in LuaJIT, there's no need to call strtoull.
Code: Select all
assert(0xffffffffffffffffULL == ffi.C.strtoull("0xffffffffffffffff", nil, 16))
http://luajit.org/ext_ffi_api.html (see "Extensions to the Lua parser" at the bottom of the page)
ivan
Party member
Posts: 1915 Joined: Fri Mar 07, 2008 1:39 pm
Contact:
Post
by ivan » Tue Dec 17, 2019 2:55 pm
I see, that's even better. I will have to see how this change would affect the rest of the code.
Thanks grump!
ReFreezed
Party member
Posts: 612 Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:
Post
by ReFreezed » Mon Jan 06, 2020 10:56 am
Nice, this is very useful!
ivan
Party member
Posts: 1915 Joined: Fri Mar 07, 2008 1:39 pm
Contact:
Post
by ivan » Wed Sep 02, 2020 2:18 pm
Just pushed an update upgrading the library to Steamworks v1.5.
This version includes supports for HTTP and HTTPS requests similarly to luasocket:
Code: Select all
valid = steam.request(url[, body, callback])
That's right, we've got working SSL support too!
artless
Prole
Posts: 6 Joined: Sat Jan 25, 2020 3:36 pm
Post
by artless » Wed Nov 18, 2020 10:40 am
I know this might be a silly question:
Where should I put libsteam_api.dylib in a Mac build?
I tried to put libsteam_api.dylib in the folder, inside .love file or in love.exe's folder.
None of them worked.
Error
dlopen(libsteam_api.dylib, 5): image not found
Traceback
[builtin#202]: at 0x010c345e00
[C]: in function 'require'
sworks/api.lua:43: in function 'Init'
sworks/main.lua:16: in function 'init'
main.lua:73: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
ivan
Party member
Posts: 1915 Joined: Fri Mar 07, 2008 1:39 pm
Contact:
Post
by ivan » Wed Nov 18, 2020 2:54 pm
On Mac, I placed mine in:
Code: Select all
Contents/Frameworks/libsteam_api.dylib
Please confirm if this works for you.
Users browsing this forum: Ahrefs [Bot] and 14 guests