Giter Site home page Giter Site logo

luasteam's Introduction

luasteam

Documentation Status Build Status

luasteam enables you to use SteamWorks API from Lua, for example (but not limited to) when you’re building games with Love2D.

Getting Started/Documentation

This README file is purposefully small, all our documentation is in luasteam.readthedocs.io.

Contributing

Can't find the binding you need? We accept contributions! Check our guideline and tips.

Games using luasteam

Does your game also use luasteam? Let us know here and we can add it to the list too.

luasteam's People

Contributors

aki-cat avatar davidobot avatar georgea93 avatar hylje avatar kazuo256 avatar oatmealine avatar oniietzschan avatar rilifon avatar yancouto avatar zorfmorf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luasteam's Issues

Cannot find libsteaam_api.so

Whenever I attempt to require luasteam.so I get the following error.

Error

error loading module 'luasteam' from file './luasteam.so':
libsteam_api.so: cannot open shared object file: No such file or directory

Traceback

[C]: at 0x7f86e885f310
[C]: in function 'require'
main.lua:2: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

My OS is Ubuntu Linux 64 bit.
In my current configuration I have luasteam.so and libsteam_api.so sitting in the root game folder with main.lua.

I am requiring luasteam with

steam = require 'luasteam'

I have tried the pre compiled luasteam as well as compiling it myself with Lua 5.1 .h files. I have tried putting libsteam_api in the root folder as well as the save folder and the normal sdk folder, all with the same error.

I am using the latest release of the Steamworks SDK as of November 11th. Any tips?

Thank you,

Cut a release

Hey is it possible to cut a new release since the locale changes went in?

Thanks!

ISteamUser::GetAuthSessionTicket adds additional parameter

ISteamUser::GetAuthSessionTicket now takes an extra parameter: const SteamNetworkingIdentity *pIdentityRemote.

"The identity of the remote system that will authenticate the ticket. If it is peer-to-peer then the user steam ID. If it is a game server, then the game server steam ID may be used if it was obtained from a trusted 3rd party, otherwise use the IP address. If it is a service, a string identifier of that service if one if provided."

HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pIdentityRemote  );

macOS: libluajit missing

I have trouble bundling my Love2D game on macOS. I include luasteam.so and then

	dlopen(./luasteam.so, 6): Library not loaded: /usr/local/opt/luajit/lib/libluajit-5.1.2.dylib
  Referenced from: /Users/andras/dev/terraforming-earth.git/luasteam.so
  Reason: image not found

Of course, if I install luajit with homebrew, it works fine, but I can't expect players to do so.

Love2d already includes luajit 2.0.5, so there shouldn't be a problem theoretically, we're just looking for it in the wrong place? What am I doing wrong?

Steam overlay wont show.

Hi! I managed to get luasteam working properly with all of it's features fully running, but for some odd reason the game overlay just wont show up. I'm on Ubuntu 22.04 with the latest luasteam version.
Here's my source code:

local Steam = require "luasteam"

function love.load()
    Steam.init()
    love.window.setMode(1920, 1080)
    love.window.setFullscreen(true)
    print("Steam level: " .. Steam.user.getPlayerSteamLevel())
    Steam.friends.activateGameOverlay('stats')
end

function Steam.friends.onGameOverlayActivated(data)
    if data.active then
        print("Steam overlay now active")
    else
        print("Steam overlay now inactive")
        Steam.friends.activateGameOverlay('stats')
    end
end

function love.update(dt)
    Steam.runCallbacks()
end

function love.draw()
    love.graphics.setBackgroundColor(1, 1, 1)
    love.graphics.setColor(0, 0, 0)
    love.graphics.print('Hello World!', 0, 0)
end

function love.quit()
    Steam.shutdown()
end

and here is the command line output when I run it:

[S_API] SteamAPI_Init(): Loaded '/home/gungu/.steam/debian-installation/linux64/steamclient.so' OK.
Setting breakpad minidump AppID = 2457300
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561199029178397 [API loaded no]
Steam level: 10

and just because it might help, here is what my lua file's directory contains:
data libsteam_api.so luasteam.so main.lua steam_appid.txt

Installation instructions wrong for OSX

Environment

  • OSX 11.2.3
  • LOVE 11.3 (Mysterious Mysteries)

Issue

When downloading this codebase and following the luasteam instructions....

Download the correct binary for your platform and rename it to simply luasteam.ext.

... and renaming to luasteam.ext, the library is not found:

Error

engine/external/init.lua:7: module 'luasteam' not found:
no field package.preload['luasteam']
no 'luasteam' in LOVE game directories.
no file 'luasteam' in LOVE paths.
no file './luasteam.lua'
no file '/usr/local/share/luajit-2.0.5/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam/init.lua'
no file './luasteam.so'
no file '/usr/local/lib/lua/5.1/luasteam.so'
no file '/usr/local/lib/lua/5.1/loadall.so'


Traceback

[C]: in function 'require'
engine/external/init.lua:7: in main chunk
[C]: in function 'require'
engine/init.lua:5: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

This appears to be verified by third parties as per the comments in issue #14.

Attempted resolutions

Renaming to luastream.so

Renaming to luasteam.so appears to work better (also as per those comments), however still yields the error:

Error

error loading module 'luasteam' from file './luasteam.so':
dlopen(./luasteam.so, 6): no suitable image found.  Did find:
file system relative paths not allowed in hardened programs


Traceback

[C]: at 0x010927c740
[C]: in function 'require'
engine/external/init.lua:7: in main chunk
[C]: in function 'require'
engine/init.lua:5: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

Adding cpath hack to main.lua

As per this suggestion hack cpath.

local windows = package.config:sub(1, 1) == '\\'
package.cpath = string.format("%s;%s/?.%s", package.cpath, love.filesystem.getSourceBaseDirectory(), (windows and "dll" or "so"))

Didn't work, same error as above.

Situation

Can't use library following documentation's instructions on OSX. This is different to the other issue #14, which is about releasing on OSX.

Callbacks don't seem to work for me

Here's my code. I would expect userStatsReceived to be called eventually, and onGameOverlayActivated to be called whenever I open and close the team overlay, but neither happen for me. Is there something I'm doing wrong? I've tested this with Steamwork SDK 1.42 and SDK 1.44, both behave identically.

Despite all this, I'm still able to execute setAchievement, getAchievement, storeStats, and resetAllStats, and they all appear to work in real time.

Thank you.

local Steam = require 'luasteam'

function love.load()
  Steam.init()
  Steam.userStats.requestCurrentStats()
end

-- This never gets triggered!!
function Steam.userStats.userStatsReceived(...)
  print('userStatsReceived')
  print(...)
end

-- Activating and Deactivating the game overlay does not trigger this.
function Steam.userStats.onGameOverlayActivated(data)
  print("Steam overlay is now " .. (data.active and "active" or "inactive"))
end

function love.update()
  Steam.runCallbacks()
end

function love.quit()
  -- prints:
  --   Setting breakpad minidump AppID = 1040490
  --   Steam_SetMinidumpSteamID:  Caching Steam ID:  76561197967143787 [API loaded no]
  Steam.shutdown()
end

Add License

For this particular project, a permissive license such as MIT is more suitable.

Releasing on MacOS

Hello! I am trying to build my game for release on macos. Following the 'Creating a macOS Application' steps here: https://love2d.org/wiki/Game_Distribution

My game runs fine before building, but if I try to run the actual built game I get the follow error:

Error

main.lua:1: module 'luasteam' not found:
no field package.preload['luasteam']
no 'luasteam' in LOVE game directories.
no file 'luasteam' in LOVE paths.
no file './luasteam.lua'
no file '/usr/local/share/luajit-2.0.5/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam.lua'
no file '/usr/local/share/lua/5.1/luasteam/init.lua'
no file './luasteam.so'
no file '/usr/local/lib/lua/5.1/luasteam.so'
no file '/usr/local/lib/lua/5.1/loadall.so'


Traceback

[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

I have tried placing the luasteam.so in the different directories inside my game, but to no avail.

I think this has something to do with how love is loading (or not loading) libraries in fused mode, but I am a bit stumped as to how to proceed from here.

[Feature] Add ISteamApps' BIsSubscribed and GetAppInstallDir

I'm not much of a C++ person which is why i am writing this
I am currently working a better workshop helper tool for SCP Containment Breach Multiplayer, take gmpublisher (Garry's Mod workshop assistant tool) as an example. Not only would these be helpful for other people, it would also further enhance what this library can do

Game invite functionality

Hi there, would it be possible to add the Invite To Game feature that can be used in the Friends overlay to invite a friend to a game? As far as I understood, there are three functions and one callback that would enable this in Luasteam.

functions:
ActivateGameOverlayInviteDialog (https://partner.steamgames.com/doc/api/ISteamFriends#ActivateGameOverlayInviteDialog)
InviteUserToGame
(https://partner.steamgames.com/doc/api/ISteamFriends#InviteUserToGame)
GetLaunchCommandLine
(https://partner.steamgames.com/doc/api/ISteamApps#GetLaunchCommandLine)

callbacks:
GameRichPresenceJoinRequested_t
(https://partner.steamgames.com/doc/api/ISteamFriends#GameRichPresenceJoinRequested_t)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.