Coder Social home page Coder Social logo

greenheartgames / greenworks Goto Github PK

View Code? Open in Web Editor NEW
1.5K 57.0 150.0 1.03 MB

a node.js plugin to integrate nw.js/electron games with steamworks

License: MIT License

Python 8.31% JavaScript 5.07% C++ 86.26% Shell 0.02% C 0.34%
steamworks steam steam-games electron nwjs nodejs

greenworks's Introduction

Greenworks

  • Greenworks is a node.js addon that allows you to integrate your HTML5 game (or app) with Steamworks by exposing a number of Steamworks APIs to JavaScript.
  • Greenworks was originally developed by Greenheart Games to enable Steam integration in Game Dev Tycoon. Since then, it has been open-sourced and is used in many other projects.
  • Currently Greenworks supports:
    • node v0.8, v0.10, v0.12, v4, v5, v6, v7, v8, v9 and v10+
    • NW.js v0.8, v0.11+
    • Electron v1.0.0+
    • Steam SDK v1.59
  • Greenworks is built using Native Abstractions for Node.js to support different node versions.
  • The project is currently funded by Greenheart Games and other donors.

Download

Prebuilt binaries of Greenworks for NW.js & Electron can be found on the releases page.

You can also download daily automated builds for a variety of platforms (electron, nw.js, node) and systems (Windows, Mac Linux - 32/64 bit). This is site is graciously provided by @armaldio.

Documentation

Guides and the API references are located in docs directory.

Contributions

This project is not actively developed but is maintained at best-effort. Due to my limited time, responses to issues and code reviews may be slow. If you need additional support or have big great ideas, please reach out to the maintainer.

While many games uses Greenworks successfully in production, depending on your needs, you might want to consider alternatives.

License

Greenworks is published under the MIT license. See the license file for details.

Twitter

If you use Greenworks, please let us know at @GreenheartGames and feel free to add your product to our product list.

greenworks's People

Contributors

abesco avatar acknowledge avatar andyfleming avatar armaldio avatar benaadams avatar danielklug avatar dfabulich avatar dnoberon avatar dos1 avatar ecdeveloper avatar emad88 avatar evanrelf avatar goldfire avatar hokein avatar jamesnesta avatar kefniark avatar kruithne avatar liam-middlebrook avatar madspyxfr avatar maflores16 avatar mikaldev avatar patrickklug avatar riadd avatar scx110a avatar valtaroth avatar voxpelli avatar zamiell avatar zekfad 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  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

greenworks's Issues

No Steam Overlay?

Hello!

First off, thank you so much for sharing Greenworks! I'm trying to get it working with node-wekbit. I got it working easily enough and have confirmed that the Steam API is initializing, however there's no steam overlay. My game is WebGL based and I init the Steam API in the node-main file I specified in my manifest, so it should be initialized before the DOM is created and hopefully before the OpenGL device is created. I've also tried exposing SteamFriends()->ActivateGameOverlay to node, but it too fails. I'm guessing the overlay isn't hooking in at all.

Is there a way to get this working without making a custom fork of node-webkit and implementing Greenworks directly into it?

Thanks!

Triggering SteamAPI_RunCallbacks()

Hi,

I'm trying to add support to trigger SteamAPI_RunCallbacks(). I had this working with a custom version of greenworks 4 and NWJS, but I'm having trouble with greenworks 5 and electron (I'm not yet sure if it's an electron compatibility issue, or whether I'm doing something wrong with the new NAN syntax)

I'd like to ask for a sanity check of this code....

I'm defining a function to call the steam api like this (in greenworks_api.cc) :

 NAN_METHOD(RunSteamApiCallbacks) {
   Nan::HandleScope scope;
   SteamAPI_RunCallbacks();
   info.GetReturnValue().Set(Nan::Undefined());
 }

And exposing it like this:

   Nan::Set(target,
       Nan::New("RunSteamApiCallbacks").ToLocalChecked(),
       Nan::New<v8::FunctionTemplate>(RunSteamApiCallbacks)->GetFunction());

However, if I call this from the JS while the overlay is open (in electron & windows), then either the application hangs or crashes.

Can you see any problems with the code? Or have any ideas what else might be going wrong?

Thank you

Remove zlib and minzip dependency

Currently greenworks relies on zlib and minzip libraries for greenworks zip APIs(greenwork.Utils.createAchieve and greenwork.Utils.extractAchieve).
It's not worthy to implement and maintain them in C++, so I plan to remove remove these two libraries in the future.

The zip API will be reimplemented in JS part. Below are some goals:

  • Remove zlib and 'minzip' libraries.
  • Reimplement in zip API in JS part, and keep compatible with the previous.

This will be done after porting Steam workshop APIs.

Version function for API

It would be really nice to have a version property or function in the API, which returned the greenworks version.

linux app crashes when run through steam client

I'm not sure that this is the right place, but when I deploy my linux app into steam, I can't run it from the steam client. Navigating to the app directory and starting the app directly from terminal works fine. Only when starting it through the "play" button from inside the steam client it prints out..

ERROR: ld.so: object '/home/riad/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

Nothing else happens. As far as I can tell the error message is actually not the cause of the problem, as it seems to be expected for 64bit apps that are started from Steam.

There is a nw process running, but it does not open any windows. Clicking the play again results in a "app already running error message". I also looked for crash dumps in the /tmp/ folder but could only find logs that contain the error message above.

Is there some way to ramp up the verbosity of nw.js to give me a chance to understand what might be happening? Anybody having seen something similar or having an idea how I might debug this? Any help would be highly appreciated.

Cannot build NWJS with greenworks

I am running into issues trying to build NWJS.

Running nw-gyp build produces this error:

C:\greenworks>nw-gyp build /m
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
child_process: customFds option is deprecated, use stdio instead.
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/m',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
  minizip.vcxproj -> C:\greenworks\build\Release\\minizip.lib
  zlib.vcxproj -> C:\greenworks\build\Release\\zlib.lib
  greenworks_async_workers.cc
..\src\greenworks_async_workers.cc(192): error C2143: syntax error : missing ')
' before '{' [C:\greenworks\build\greenworks-win32.vcxproj]
..\src\greenworks_async_workers.cc(192): error C2059: syntax error : ')' [C:\gr
eenworks\build\greenworks-win32.vcxproj]
..\src\greenworks_async_workers.cc(192): error C2143: syntax error : missing ';
' before '{' [C:\greenworks\build\greenworks-win32.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\James\AppData\Roaming\npm\no
de_modules\nw-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Users\\James\\AppData\\Roaming\\npm\\node_modules\\
nw-gyp\\bin\\nw-gyp.js" "build" "/m"
gyp ERR! cwd C:\greenworks
gyp ERR! node -v v0.12.7
gyp ERR! nw-gyp -v v0.12.4
gyp ERR! not ok

greenworks.getSteamId() opens steamOverlay

when I do greenworks.getSteamId() to retrieve the steam user info the steam overlay activates itself on its own.

This is not at all the expected behaviour :)

greenworks 0.4.1 sdk 1.34

Problems compiling against electron on windows

I'm getting many errors when trying to compile greenworks for electron. I'm trying v0.34.1, but have tried older versions back to 0.29, and get the same problem. I've been able to compile greenworks against nwjs without problems on this machine, so not really sure what's wrong.

The commands I'm using are:

 set HOME=C:\Dev\.electron-gyp
 node-gyp rebuild --target=0.34.1 --arch=ia32 --dist-url=https://atom.io/download/atom-shell 

The initial errors are (followed by a few hundred more):

 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(336): error C2988: unrecognizable template declaration/definition (..\src\greenworks_utils.cc) [C:\xxx\greenworks\build\greenworks-win32.vcxproj]
 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(336): error C2059: syntax error : 'using' (..\src\greenworks_utils.cc) [C:\xxx\greenworks\build\greenworks-win32.vcxproj]
 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(469): error C2988: unrecognizable template declaration/definition (..\src\greenworks_utils.cc) [C:\xxx\greenworks\build\greenworks-win32.vcxproj]
 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(469): error C2059: syntax error : 'using' (..\src\greenworks_utils.cc) [C:\xxx\greenworks\build\greenworks-win32.vcxproj]
 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(576): error C2061: syntax error : identifier 'WeakCallbackType' (..\src\greenworks_utils.cc) [C:\xxx\greenworks\build\greenworks-win32.vcxproj]
 C:\Dev\.electron-gyp \.node-gyp\0.34.1\deps\v8\include\v8.h(642) : see reference to class template instantiation 'v8::PersistentBase<T>' being compiled

Gamepad support

Steam is shipping their controllers now. Would be good if we could get some support for them as well.

For starters ISteamUtils::ShowGamepadTextInput() support would be very handy to be triggered on text inputs. I did not find a way to detect if player is using a Steam controller from the documentation, but that would be another requirement for calling the ShowGamepadTextInput.

greenworks.activateGameOverlay() crashes NW

Let me start by explaining my a little weird setup:
I am using Node-webkit to package a flash game running on Stage3D (so wmode=direct for GPU rendering). This causes flash to intercept all keyboard events before they even reach the browser as long as flash has the focus. Shift+tab works perfectly fine if I give the focus back to the browser.

Now I attempted to use ExternalInterface when flash detects shift+tab being pressed to call a JS function, but...

Calling greenworks.activateGameOverlay() with any string param (even a correct one) just silently crashes node webkit.

I tried building greenworks myself because people in a different thread mentioned that it solves this issue but when I try to use my build all I get is Uncaught Error: Module did not self-register.

So, any chance for activateGameOverlay() to work any time soon?

My nw version:

nw.js v0.12.1
io.js v1.2.0
Chromium 41.0.2272.76
commit hash: 51300af-0aa4273-be948af-459755a-2bdc251-1764a45

Possible to build greenworks against electron on windows?

Is it possible to build greenworks against electron on windows? These instructions appear to be linux only:

HOME=~/.electron-gyp node-gyp rebuild --target=<0.29.2 or other versions> --arch=x64 --dist-url=https://atom.io/download/atom-shell

Steam Overlay doesn't work with me

Hello guys, I need help to make Steam Overlay work. I have checked multiple solutions across the web and still can't get it to show in my game (tried a lot of different chromium args). I already managed to start the Steamworks API but Steam Overlay still doesn't work. Could you help me?

Support for NW.js 0.13+

NW.js 0.13.0 is now in beta (beta2 is out). I can't seem to get the latest Greenworks to work with it. The require("./greenworks") line throws "Uncaught Error: The specified procedure could not be found.
?\C:\Users\Ashley\AppData\Local\Temp\nw9220_5633\greenworks-win32.node". (I've checked, the file given in that path does exist, but it sounds like it can't find a method within it.)

Could Greenworks be updated for 0.13 support?

SteamUserStats()->ResetAllStats()

Just wondering if you have implemented reset achievements?
like SteamUserStats()->ResetAllStats()

Or if its available some how though greenworks?
Its a convenient way in development to reset and test achievements triggers.

what files is used in windows? steam_api.dll or steam_api64.dll?

there is simply no libsteam_api.dll in the steam sdk.
or are you referring to the regular steam_api.dll?
tried that as well without luck.
if i hard-code in steam_api64.dll in the binding.gyp a greenworks.node is built.
But trying to load it node-webkit it will just say error no error.

Is the build outdated to the current sdk? or what am i missing?
Need some help.

image

[0.5.0] Game crashes when opening Steam Overlay (Windows 32bit)

I just downloaded your newest release and made a test build:

  • 32bit application
  • Running on Windows 7
  • Running from Steam

Steam successfully connects to the application (I see this small overlay popup in the bottom right corner).

As soon as I hit "Shift + Tab" to open the overlay, the whole application crashes and closes itself.

These are the components I used:

  • nwjs-v0.12.1-win-ia32
  • steamworks_sdk_134
  • greenworks-v0.5.0-nw-0.12.1

I will run some more tests to see what I can do about that.

Upgrade NAN to v2.0.5

Recently, iojs v3.0 has been released with v8 v4.4.

The API changes in the new iojs is a bit significant due to the v8's new API. As a result, we need to upgrade NAN v2 to make Greenworks work on iojs v3.

Building greenworks "unresolved external symbol"

After running npm install I get this:

minizip.lib(unzip.obj) : error LNK2001: unresolved external symbol inflateEnd [E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(unzip.obj) : error LNK2001: unresolved external symbol inflate [E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(unzip.obj) : error LNK2001: unresolved external symbol inflateInit2_ [E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(unzip.obj) : error LNK2001: unresolved external symbol crc32 [E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(zip.obj) : error LNK2001: unresolved external symbol deflateInit2_[E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(zip.obj) : error LNK2001: unresolved external symbol get_crc_table[E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(zip.obj) : error LNK2001: unresolved external symbol deflateEnd [E:\Git\greenworks\build\greenworks-win64.vcxproj]
minizip.lib(zip.obj) : error LNK2001: unresolved external symbol deflate [E:\Git\greenworks\build\greenworks-win64.vcxproj]
E:\Git\greenworks\build\Release\greenworks-win64.node : fatal error LNK1120: 8unresolved externals [E:\Git\greenworks\build\greenworks-win64.vcxproj]

I have Visual Studio 2015 installed, not sure if that could affect it.

SteamUserStats() API for better achievement support.

At some stage it would be good to support more of the SteamUserStats() API, which is described in the ugs section of the steam docs.

This will be particular useful to get more advanced achievements features, such as resetting achievements, supporting progress-achievements and retrieving more info for achievements from steam.

implement activateGameOverlay and isGameOverlayEnabled

Correct me if I'm wrong @hokein but I think greenworks is missing the feature to activate the steam overlay. The guys from Lost Decade Games implemented this in their steamboat experiment.

Given that greenworks now supports 0.11 it would be good to implement both activateGameOverlay and isGameOverlayEnabled in greenworks. I'll just put it as a todo for version next.

Please clarify point in documentation

Please could you clarify greenworks binaries directory and code directory in the docs? It wasn't clear to me which these were.

Copy steam_api.dll/libsteam_api.dylib/libsteam_api.so library from the Steamworks SDK(<steam_sdk_path>/redistributable_bin/) to greenworks binaries directory.

Create a steam_appid.txt file with your Steam APP ID under code directory.

Errorhandling in Windows 10 different (readFromTextFile)

Hello,

The error handling under Windows 10 is a bit different with regards to the "readFromTextFile" method.

Example code:

            greenworks.readTextFromFile(
                "fileNotFound.txt",
                function (content) {
                    alert("No error!");
                },
                function () {
                    alert("File not found!");
                }
            );

The file "fileNotFound.txt" does not exist.

Under Linux, Mac OS X, and any Windows version except Windows 10, this will alert "File not found!".

Under Windows 10, this will result in a "No error!" alert. The content is an empty string.

Just in case someone relies on that error function to create that missing file... like I did. ;)

cannot build greenworks

I'm currently writing a Construct 2 plugin based on greenworks. I'm done on C2 side with a simple test, currently i'm trying to build greenworks with node-gyp for windows.

I have installed all depedencies for node-gyp, following this: https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup.

When i try to build it, i get this:

PS C:\Users\MaliJuda\Documents\steam_plugin\greenworks-master> node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.12.2
gyp info using node@0.10.21 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\MaliJuda\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\MaliJuda\\Documents\\steam_plugin\\greenworks-master\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\MaliJuda\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\MaliJuda\\.node-gyp\\0.10.21\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\MaliJuda\\.node-gyp\\0.10.21',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\MaliJuda\\Documents\\steam_plugin\\greenworks-master',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\MaliJuda\\Documents\\steam_plugin\\greenworks-master\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  move_node_module
  The system cannot find the file specified.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited w
ith code 1. [C:\Users\MaliJuda\Documents\steam_plugin\greenworks-master\build\action_after_build.vcxproj]
  main.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used,
 but unwind semantics are not enabled. Specify /EHsc [C:\Users\MaliJuda\Documents\steam_plugin\greenworks-master\build\
greenworks.vcxproj]
..\main.cpp(5): fatal error C1083: Cannot open include file: 'C:\Users\MaliJuda\Documents\steam_plugin\greenworks-maste
r/steamworks-sdk/public/steam/steam_api.h': No such file or directory [C:\Users\MaliJuda\Documents\steam_plugin\greenwo
rks-master\build\greenworks.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\MaliJuda\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:267:
23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Users\\MaliJuda\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"

gyp ERR! cwd C:\Users\MaliJuda\Documents\steam_plugin\greenworks-master
gyp ERR! node -v v0.10.21
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok

I've googled, found and tried to apply a lot of different solutions but with no luck.

I'm using a 64-bit version of node, could it be that my setup is wrong?

Could you provide a more detailed guide on building greenworks on Windows?

Thanks in advance!

Request new API method: greenworks.isGameOverlayActive()

It would be nice to have an API method like greenworks.isGameOverlayActive() that tells me about whether or not the Steam overlay is active.

Regarding Valve's documentation, there are "signals" being sent on certain interactions of the user:

Communication from the overlay to your game
The following signals (callbacks) are sent from Steam to your game, based on user action in the overlay:
GameOverlayActivated_t - posted when game overlay activates or deactivates. The game can use this to be pause or resume single player games.

According to the file steam/isteamfriends.h, the value passed will either be true or false.

Or there could be event handlers like "onGameOverlayActivated()" and "onGameOverlayDeactivated()" that trigger when these signals get submitted.

But I don't know whether there is a general "signal listener" in the Greenworks module yet. This would be quite useful, too, because there are a lot of signals that could be handled.

Perhaps you could take this into consideration for your next release.

Thanks!

greenworks_async_workers.cc compilation errors

Hi,

I'm trying to compile the latest version in the repo (greenworks-master), but am getting some compilation errors in greenworks_async_workers.cc (I can compile the 0.4.1 release without problems).

    ..\src\greenworks_async_workers.cc(192): error C2143: syntax error : missing ')' before '{' [xxx\greenworks-master\build\greenworks-win32.vcxproj]
    ..\src\greenworks_async_workers.cc(192): error C2059: syntax error : ')' [xxx\greenworks-master\build\greenworks-win32.vcxproj]
    ..\src\greenworks_async_workers.cc(192): error C2143: syntax error : missing ';' before '{' [xxx\greenworks-master\build\greenworks-win32.vcxproj]

Seems to be caused by this change:

71b5219

   void ClearAchievementWorker::HandleOKCallback() {
     NanScope();
  -  v8::Local<v8::Value> argv[] = { NanNew(success_) };
  -  callback->Call(1, argv);
  +  callback->Call(0, {});
   }

Electron support

Custom building Greenworks for latest Electron seams to work.
Calling greenworks.initAPI() from steam works as intended.

Achievements:
The Steam UI is not visible but the achievement is triggered on Steam.

Overlay:
No UI or overlay is visible when triggering the API calls, it seams to be unresponsive and not working.

Question:
Most of the API calls seams to work but the visual ones.
Is there any overlay support for Electron with special workarounds
like the nw.js version or is just not supported at this current time?
If so, what are the special settings to get it working in Electron?
forceRefreshCanvas diden't do the trick.

What is steam_appid.txt used for?

Hi,

I've noticed that things seem to run normally even when the steam_appid.txt is missing. Please could you clarify what the file is used for?

Thanks

Linkage error

After some research it seems that greenworks is unable to link the dll for steam.
(using sdk 1.32)
it says

Error: The specified procedure could not be found.
C:\[...]\win64\data\lib\greenworks-win64.node

I tried both steam and steam64 dll in the lib folder, the data folder and the win64 folder ( in case it was a path issue ). I saw somewhere that it might be related another to a missing dll.

Thnaks for your help and great job !

Info API example and additional questions

This is not really an issue.
Can you put example of usage greenworks.getSteamId() into samples?

Im beginner in JS/Node. I was working only with HTML and PHP.
From what I understand - I can create multiplayer game (I will be able to invite people from steam to game and they will be able to join game in any moment) with Greenworks, yes?
// From "games using greenworks" only Might & Magic Heroes Online looks like true multiplayer game.
// im planning to use Socket.io as server in my APP
I just want to be sure of that before I fall into learning JS.

How to debug 'false' result from initAPI() ?

Hi,

I'm getting a false result from initAPI(), but no error or further information , so am now a bit stuck...

Under what conditions would initAPI() return false?
What can I do to debug this issue further?

Thank you

Greenworks module cannot be found, but file is in the correct location

Using both these methods:
http://html5hub.com/deploying-hybrid-html5-games-on-the-desktop-using-node-webkit/
https://github.com/mllrsohn/grunt-node-webkit-builder/

Node-webkit reports the following error:
Uncaught Error: The specified module could not be found.
C:\Users\AppData\Local\Temp\nw10964_10616\lib\greenworks-win64.node

and these lines from the sample code don't work:
var greenworks = require('./greenworks');
document.write(greenworks.initAPI());

However copying that file location into windows explorer shows that the file exists. I'm not sure what this means.

Matchmaking

Been studying up different libraries and stuff for game making, came across this and thought it was very awesome. I noticed however it is quite bare, with no support for matchmaking (amongst a few other things).

I was wondering if you guys had this in the pipeline, or are fairly content with what you have and expect outside devs to plug in the missing pieces?

Steamworks version?

Hey there,

Thanks for sharing your work! I have managed to get the API initialized while running Steam but get no notification when my app loads (typically this pops at the bottom right corner when games load) and the following note shows on my console when debugging:

Steam_SetMinidumpSteamID: Caching Steam ID: XXX [API loaded no]

Does this mean the API is available but not loaded? I have used the prebuilt release you provided and also built my own targeting nodewebkit 0.8.4. I'm using Steamworks 1.2.8

I have not tried loading the game from within the client yet but plan to do so next. Wondering which release of Steamworks you are using so I can compare apples to apples :)

Thanks again.

Error : "The specified module could not be found. xxxx\greenworks-win64.node"

Hi,

I have compiled greenworks for nwjs 0.12.3, using the following options:

    nw-gyp configure --target=0.12.3 --arch=x64

This completed without error. However, when I try to include greenworks, using:

    var greenworks = require('./greenworks-win64');

I get the error

    Error : "The specified module could not be found. xxxx\greenworks-win64.node"'

I have confirmed that the compiled greenworks-win64.node file exists in the same directory as the nw.exe, so am a bit confused by this error.

Does anyone know what might be causing this?

Note that if the file is simply missing, or referred to incorrectly then it's a distinctly different error:

     Error {code: "MODULE_NOT_FOUND", stack: "Error: Cannot find module './greenworks-win64'"}

No method "initAPI"

I'm getting this error when trying to call the initAPI method:

Uncaught TypeError: Object [object Object] has no method 'initAPI' 

The greenworks module appears be required without a problem, and the call to require does return an object. (See screenshot)

I'm using the prebuilt binaries and node-webkit 0.8.4 on OSX.

greenworks-osx.node and libsteam_api.dylib are both present at the root of the app.

Any suggestions? Thanks in advance!

screen shot 2014-02-19 at 4 19 35 pm

Steam Overlay Doesn't Work with NW.js v0.12.2 on Mac OS X

Through some troubleshooting and discovery, based on #16 it appears as though Steam Overlay is completely non-functional in NW.js v0.12.2 on Mac OS X, but works fine in v0.12.1. I have tried all workarounds as described on #16 as well.

I believe this is a NW.js specific-issue, as even launching a third-party program using v0.12.2 does not allow the Steam Overlay to pop-up, but in v0.12.1, it does. I posted here as it is the only place where we can maybe get some light shed on the issue. I believe it would be too specific to get any traction over on the NW.js Github.

I took a look at the changelog from 0.12.1 to 0.12.2 and I can't find anything that could of broke the functionality/rendering:
https://github.com/nwjs/nw.js/blob/master/CHANGELOG.md
https://github.com/nwjs/nw.js/commits/nw13

Perhaps it was some dependencies? No idea.

As a side note, Steam Overlay doesn't work on any Electron version that I have tried on Mac OS X. Perhaps I didn't try to go back far enough though. I assume there would be a similar "breaking" point or version, possibly back in it's atom-shell days.

EventEmitter events not firing, unless some api function called first.

I think I've found a bug with the EventEmitter code. This was with electron 31.2 though, so could be an electron compatibility issue.

I set up the electron sample project, and verified that the greenworks EventEmitter was working. I then reduced our project down to the bare minimum, but still could not get the greenworks events to fire. After trial and error, I discovered something odd: For the EventEmitter events to fire, you first need to call a random function from the api (any function, it seems) e.g. greenworks.getNumberOfPlayers(). The events will not fire unless you call something first (I'm calling initAPI() in all cases of course).

An easy way to reproduce is to comment out these lines in the electron sample main.js, and observe that the events are then not emitted.:

   greenworks.saveTextToFile('test_file.txt', 'test_content',
  function() { log('Save text to file successfully'); },
  function(err) { log('Failed on saving text to file'); });

   greenworks.readTextFromFile('test_file.txt', function(message) {
  log('Read text from file successfully.'); }, function(err) {
  log('Failed on reading text from file'); });

   greenworks.getCloudQuota(
  function() { log('Getting cloud quota successfully.') },
  function(err) { log('Failed on getting cloud quota.') });

   greenworks.activateAchievement('achievement',
  function() { log('Activating achievement successfully'); },
  function(err) { log('Failed on activating achievement.'); });

   greenworks.getNumberOfPlayers(
  function(a) { log("Number of players " + a) },
  function(err) { log ('Failed on getting number of players'); });

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.