{"id":19478890,"url":"https://github.com/xan105/node-lobby_connect","last_synced_at":"2025-04-25T15:30:58.940Z","repository":{"id":49620860,"uuid":"278059403","full_name":"xan105/node-lobby_connect","owner":"xan105","description":"Discover people playing on the network using the Goldberg SteamEmu with the launch parameter to connect to their game","archived":false,"fork":false,"pushed_at":"2024-10-26T01:55:49.000Z","size":12874,"stargazers_count":11,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T03:20:00.535Z","etag":null,"topics":["lobby","nodejs","steam","steamemulator","windows"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xan105.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"xan105","custom":"https://www.paypal.me/xan105"}},"created_at":"2020-07-08T10:27:26.000Z","updated_at":"2024-10-26T01:55:59.000Z","dependencies_parsed_at":"2024-10-26T14:58:30.367Z","dependency_job_id":null,"html_url":"https://github.com/xan105/node-lobby_connect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-lobby_connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-lobby_connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-lobby_connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xan105%2Fnode-lobby_connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xan105","download_url":"https://codeload.github.com/xan105/node-lobby_connect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250844227,"owners_count":21496525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lobby","nodejs","steam","steamemulator","windows"],"created_at":"2024-11-10T19:51:56.184Z","updated_at":"2025-04-25T15:30:55.739Z","avatar_url":"https://github.com/xan105.png","language":"C++","funding_links":["https://patreon.com/xan105","https://www.paypal.me/xan105"],"categories":[],"sub_categories":[],"readme":"About\n=====\n\nFFI bindings to `lobby_connect` from [Goldberg SteamEmu](https://gitlab.com/Mr_Goldberg/goldberg_emulator)  but [recompiled as a dll](https://gitlab.com/Mr_Goldberg/goldberg_emulator/-/issues/96).\n\nDiscover people playing on the network using the Goldberg SteamEmu with the launch parameter to connect to their game.\n\nThis can be used in Node.js/Electron.\u003cbr/\u003e\n💡 Usage without Node/JavaScript is also [explained down below](https://github.com/xan105/node-lobby_connect#usage-without-node--javascript).\n\nFeel free to make a cool looking GUI for this 😃\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/xan105/node-lobby_connect/raw/master/screenshot/gui.png\"\u003e\u003cbr /\u003e\n\u003cem\u003eExample build with Electron\u003c/em\u003e\n\u003c/p\u003e\n\nExample\n=======\n\n```js\nimport { lobbyPlayerState } from \"@xan105/lobby_connect\";\n\nsetInterval(function(){ \n  lobbyPlayerState()\n  .then(console.log)\n  .catch(console.error);\n}, 3000);\n\n/*output example\n[] //Nobody on the network\n[ { name: 'Xan', appID: 466560, connect: '' } ] //In game\n[ { name: 'Xan', appID: 466560, connect: '+connect_lobby 109212296511539930' } ] //lobby available\n*/\n```\n\nInstall\n=======\n\n```\nnpm install @xan105/lobby_connect\n```\n\nAPI\n===\n\n⚠️ This module is only available as an ECMAScript module (ESM) starting with version 2.0.0.\u003cbr /\u003e\nPrevious version(s) are CommonJS (CJS) with an ESM wrapper.\n\n## Named export\n\n### `lobbyPlayerState(): Promise\u003cobj[]\u003e`\n\nDiscover people playing on the network.\n\nReturn an array of `Player` object as:\n\n```ts\n{\n  name: string, //player's name\n  appID: number, //game's appid\n  connect: string //the launch parameter to connect to the player's game\n}\n```\n\nBuild\n=====\n\nThe dll src is located at `lib\\src\\goldberg_emulator\\lobby_connect_dll.cpp`\n\nIf you want to build the dll yourself please see the build instructions for the goldberg emulator (https://gitlab.com/Mr_Goldberg/goldberg_emulator#windows).\nWhen your env is set. Run the following npm script in the root dir of this package :\n\n```js\nnpm run-script build_x86 //for x86\nnpm run-script build_x64 //for x64\n\n//or\n\nnpm run-script build //for both x86 \u0026 x64\n```\n\nNB: `npm run-script update` will `git pull` ./lib/src/goldberg_emulator\n\nUsage without Node / JavaScript\n===============================\n\nYou can bind directly to the dynamic link library (dll) found in `lib/dist` with any lang that allows for FFI (_Foreign Function Interface_) with standard C declaration (c-shared).\n\nHave a look at the bindings in `lib/lobby.js` to get a feel for it. Even if you don't know any JavaScript. It's rather simple.\n\nThere are 3 functions exported : \n - lobby_ready(int delay): int\n - lobby_player_count(): int\n - lobby_player_info(int playerIndex): `\u003cPlayer\u003e`\n\n `\u003cPlayer\u003e` being the following Struct:\n```c\nstruct {\n  const char *name;\n  int appID;\n  const char *connect;\n  uint64 lobby;\n};\n```\n\n1. Use `lobby_ready()` with a delay to wait for a few seconds for connections (_delay * 10_) (Originally Mr. Goldberg uses 200ms).\u003cbr/\u003e\nIt returns 1 (true) if SteamAPI is initialized; 0 (false) otherwise.\n\n2. Use `lobby_player_count()` to get how many people they are on the network.\n\n3. Loop until max number of people from the above (_step2_) using `lobby_player_info()` to get each player information (Player Struct).\n\nIf you have a `connect` string then that's your connect argument to pass to the game;\nOtherwise transform the uint64 lobby to a string and append \"+connect_lobby\" to it.\n\nDont' forget credits and license and you are done :wink:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fnode-lobby_connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxan105%2Fnode-lobby_connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxan105%2Fnode-lobby_connect/lists"}