Skip to content

Commit

Permalink
Use SDK 158a
Browse files Browse the repository at this point in the history
  • Loading branch information
yancouto committed Jan 14, 2024
1 parent 92598c8 commit 3d0736c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ addons:
- g++-multilib
filter_secrets: false
install:
- curl -u yancouto:$SDK_TOKEN -sL https://raw.githubusercontent.com/yancouto/private-steamworks-sdk/master/steamworks_sdk_155.zip
- curl -u yancouto:$SDK_TOKEN -sL https://raw.githubusercontent.com/yancouto/private-steamworks-sdk/master/steamworks_sdk_158a.zip
-o sdk.zip
- unzip -q sdk.zip
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install -y visualstudio2017-workload-vctools; fi
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ While developing, we recommend you just worry about compiling to the platform yo

### Linux 64

Install package `libluajit-5.1-dev`. Run `make linux64`.
Install package `libluajit-5.1-dev`. Run `make linux64`. You might need to change the `Makefile` var `GNU_IPATHS` to use `-I/usr/include/luajit-2.1` instead, depending on your install. Don't commit that, as it will break continuous integration.

### Linux 32

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ OSX_IPATHS=-I$(THIRD_PARTY)/include/
OSX_FLAGS=$(OSX_IPATHS) $(STDLIB_VER)

GNU_OUT=luasteam.so
# You might need to change this to luajit-2.1 depending on your install. Don't commit it.
GNU_IPATHS=-I/usr/include/luajit-2.0
GNU_FLAGS=$(GNU_IPATHS) $(STDLIB_VER) -lluajit-5.1

Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Then copy this file to the same directory as your lua files, and make sure ``req

.. warning::

You also need to copy the correct SteamWorks library to the same directory. This library is not on the luasteam repository, and must be downloaded through the `SteamWorks website <https://partner.steamgames.com/downloads/list>`_. This version of luasteam is guaranteed to work with SteamWorks SDK v1.55, but probably works with future versions.
You also need to copy the correct SteamWorks library to the same directory. This library is not on the luasteam repository, and must be downloaded through the `SteamWorks website <https://partner.steamgames.com/downloads/list>`_. This version of luasteam is guaranteed to work with SteamWorks SDK v1.58a, but probably works with future versions.

After you download the SDK, you should copy the corresponding library for your platform. Here is a cheat-sheet:

Expand Down
4 changes: 4 additions & 0 deletions docs/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Function Reference
-- Now do something with it
end

.. warning::

This function does not return a `SteamNetworkingIdentity` object. If this is needed, it needs to be implemented on the luasteam side.

.. function:: user.cancelAuthTicket ()

:param number ticketHandle: The ticket handle to cancel the auth ticket for. You need to call this once you are done using a requested or scheduled ticket. Make sure to call this for any open ticket handles when quitting your application.
Expand Down
10 changes: 6 additions & 4 deletions src/user.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "user.hpp"
#include "const.hpp"
#include <sstream>
#include <iomanip>
#include <sstream>

// ============================
// ======== SteamUser =========
Expand Down Expand Up @@ -65,12 +65,14 @@ EXTERN int luasteam_getSteamID(lua_State *L) {
return 1;
}

//HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket )
// HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket );
EXTERN int luasteam_getAuthSessionTicket(lua_State *L) {
uint32 pcbTicket = 0;
void *pTicket = malloc(1024);
// For now we're not returning this.
SteamNetworkingIdentity id;

HAuthTicket ticket = SteamUser()->GetAuthSessionTicket(pTicket, 1024, &pcbTicket);
HAuthTicket ticket = SteamUser()->GetAuthSessionTicket(pTicket, 1024, &pcbTicket, &id);

if (ticket != k_HAuthTicketInvalid) {
std::string hexTicket = bufferToHex(pTicket, pcbTicket);
Expand All @@ -88,7 +90,7 @@ EXTERN int luasteam_getAuthSessionTicket(lua_State *L) {
return 1;
}

//void CancelAuthTicket( HAuthTicket hAuthTicket )
// void CancelAuthTicket( HAuthTicket hAuthTicket )
EXTERN int luasteam_cancelAuthTicket(lua_State *L) {
HAuthTicket ticket = luaL_checkinteger(L, 1);
SteamUser()->CancelAuthTicket(ticket);
Expand Down

0 comments on commit 3d0736c

Please sign in to comment.