Giter Club home page Giter Club logo

among-js's Introduction

hi! people tend to call me kognise.

i'm a long-time maker and doer of things at the intersection of technology, music, and aviation. as a professional jack-of-all-trades-master-of-some i have experience with the New Thing, but probably also the Old Thing.

if you wish to find me, you can look on my website and in the void of space. ๐ŸŒƒ ๐Ÿ’–

my github contribution graph is generated from neuralink's internal gitlab by an automated script that can only replicate commits. i do a lot more code review than it shows.

among-js's People

Contributors

jerbear2008 avatar kognise avatar raphaelz 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

among-js's Issues

Client gets disconnected after someone joins the game

Everytime someone joins my room and the client is running Among Us disconnects the bot.
When it leaves it says "Player left due to error".
What could be causing this it happens in among us servers.
How could this be debugged?

This is not possible. Not an issue with my library, just the Among Us

This is not possible. Not an issue with my library, just the Among Us
protocol. If you want to get room data, you gotta be more creative - I
figured it out!

On Tue, Nov 17, 2020, 8:59 AM XNexusPrimeX [email protected] wrote:

I wanted to collect data from the room without connecting to it, so as not
to take up space, is there a way?
the data I need most is to know if the players are under discussion, and
which players are dead, knowing who killed that player would also be cool.
I'm asking here because I didn't understand much about your apis, I tried
several things and I couldn't

โ€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AKEVYGL67PJ6QHTZJ57YDHLSQJ6UNANCNFSM4TYTL23A
.

Originally posted by @kognise in #6 (comment)

Hey man, please, this is weird but I'm begging you, I can't find anything anywhere, do you have at least any tips on how I get this data between? it's possible? PLEASEEEEEEE ;D

parsePayloads(buffer) returns TypeError: buffer.capacity is not a function

Running this code on a buffer captured with Cap returns an error:

var { parsePayloads } = require("@among-js/packets");
var Cap = require("cap").Cap;
var decoders = require("cap").decoders;
var PROTOCOL = decoders.PROTOCOL;
const { EventEmitter } = require("events");

var c = new Cap();
var device = "\\Device\\NPF_{3964EFF5-5E70-442F-BD2A-9F7BF07E89E8}";// name of my network device
var filter =
  "portrange 22023-22923"; // capture among us traffic
var bufSize = 10 * 1024 * 1024;
var buffer = Buffer.alloc(65535); // setup buffer to hold packets
var linkType = c.open(device, filter, bufSize, buffer); // start capture
c.setMinBytes && c.setMinBytes(0);

c.on("packet", function(nbytes, trunc) { // when packet recived
  try {
    let parsed;
    if (!trunc) {
      parsed = parsePayloads(buffer);  // error
      console.log(JSON.stringify(parsed));
    } else {
      console.info("truncated packet"); // if packet does not fit in buffer
    }
  } catch (e) {
    console.error(e);
  }
});

const ev = new EventEmitter(); let something = 0;ev.on("increment", () => {something++});const timer = setInterval(() =>ev.emit("increment"), 1e5);
// keep node from exiting while waiting for packets

This is the error that appears every time a packet is captured:

TypeError: buffer.capacity is not a function
    at parsePayloads (D:\node\Among Us\node_modules\@among-js\packets\dist\packets.cjs.development.js:828:33)
    at Cap.<anonymous> (D:\node\Among Us\listener.js:22:16)
    at Cap.emit (events.js:315:20)

Am I passing the wrong thing to parsePayloads?

collect room data among us

I wanted to collect data from the room without connecting to it, so as not to take up space, is there a way?
the most accurate data is whether the players are discussing and which players are dead, knowing who killed that player and whether the player won the game would also be cool.
I'm asking here because I didn't understand much about your apis, I tried several things and I couldn't

Create a Discord community

Hey, thanks for your awesome work.
Would it be possible to create a Discord community to talk and give feedback over Among JS and global Among Us modding?
Thanks!

Public servers

Add support for the bot to join a random public game/host a game with the settings wanted. Map, and Impostors.

Disconnects due to game error when starting the game.

Every time I start a game, the client disconnects "due to a game error". Any help here?
Code:

const { AmongUsSocket } = require('@among-js/sus')
const { PlayerColor, matchmakingServers } = require('@among-js/data')
const consola = require('consola')
consola.wrapAll()

const code = 'ILCLSQ'
const username = 'Test'
const color = PlayerColor.Cyan

const s = new AmongUsSocket(username);

(async() => {
    await s.connect(22023, "127.0.0.1")
    consola.info(`Connected to server as ${username}`)

    const joined = await s.joinGame(code)
    consola.success(`Joined game ${code}`)
    consola.info(`Player id: ${joined.playerClientId}, host id: ${joined.hostClientId}`)

    await s.spawn(color)
    consola.success('Spawned player')
})().catch(consola.error)


// Clean up the socket cleanly to avoid reconnection issues.
process.on('SIGINT', () => {
    consola.info('Closing sockets')
    s.s.disconnect()
    process.exit()
})

Server kicks for room being full on connection

import { AmongUsSocket } from "@among-js/sus";
import { matchmakingServers } from "@among-js/data";

async function main() {
  new AmongUsSocket("OvalTest").connect(22023, matchmakingServers.EU[0]);
}

main();

Output:

Disconnecting by request:
The game you tried to join is full.
Check with the host to see if you can join next round.

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.