Skip to content

Commit

Permalink
HOTFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
OhMyGuus committed Dec 25, 2020
1 parent 8368dc7 commit 5b88cbd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crewlink-beta",
"version": "1.1.98-beta.6",
"version": "1.1.98-beta.9",
"license": "GPL-3.0-or-later",
"description": "Free, open, Among Us proximity voice chat",
"repository": {
Expand Down Expand Up @@ -55,7 +55,7 @@
"react-router-dom": "^5.2.0",
"react-spinners-kit": "^1.9.1",
"react-tooltip-lite": "^1.12.0",
"registry-js": "^1.12.0",
"registry-js": "^1.13.0",
"simple-peer": "https://github.com/vrnagy/simple-peer.git",
"socket.io-client": "^2.3.1",
"source-map-support": "^0.5.16",
Expand Down
9 changes: 4 additions & 5 deletions src/main/GameReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ export default class GameReader {
this.checkProcessOpen();
if (this.PlayerStruct && this.offsets && this.amongUs !== null && this.gameAssembly !== null) {
let state = GameState.UNKNOWN;
console.log(this.offsets.meetingHud[0].toString(16));
const meetingHud = this.readMemory<number>('pointer', this.gameAssembly.modBaseAddr, this.offsets.meetingHud);
const meetingHud_cachePtr = meetingHud === 0 ? 0 : this.readMemory<number>('pointer', meetingHud, this.offsets.meetingHudCachePtr);
const meetingHud_cachePtr = meetingHud === 0 ? 0 : this.readMemory<number>('uint32', meetingHud, this.offsets.meetingHudCachePtr);
const meetingHudState = meetingHud_cachePtr === 0 ? 4 : this.readMemory('int', meetingHud, this.offsets.meetingHudState, 4);
const gameState = this.readMemory<number>('int', this.gameAssembly.modBaseAddr, this.offsets.gameState);

Expand Down Expand Up @@ -117,7 +118,6 @@ export default class GameReader {
crewmates++;
}
}

if (this.oldGameState === GameState.DISCUSSION && state === GameState.TASKS) {
if (impostors === 0 || impostors >= crewmates) {
this.exileCausesEnd = true;
Expand All @@ -137,6 +137,7 @@ export default class GameReader {
const hostId = this.readMemory<number>('uint32', this.gameAssembly.modBaseAddr, this.offsets.hostId);
const clientId = this.readMemory<number>('uint32', this.gameAssembly.modBaseAddr, this.offsets.clientId);

console.log(gameState,meetingHudState,state)

const newState: AmongUsState = {
lobbyCode: this.gameCode || 'MENU',
Expand Down Expand Up @@ -204,9 +205,7 @@ export default class GameReader {
readMemory<T>(dataType: DataType, address: number, offsets: number[], defaultParam?: T): T {
if (!this.amongUs) return defaultParam as T;
if (address === 0) return defaultParam as T;
if (this.is_64bit && (dataType == 'pointer' || dataType == 'ptr')) {
dataType = 'uint64';
}
dataType = (dataType == 'pointer' || dataType == 'ptr')? (this.is_64bit? 'uint64' : 'uint32') : dataType;
const { address: addr, last } = this.offsetAddress(address, offsets);
if (addr === 0) return defaultParam as T;
return readMemoryRaw<T>(
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (typeof window !== 'undefined' && window.location) {

enum AppState { MENU, VOICE }

export default function App() {
export default function App() : JSX.Element {
const [state, setState] = useState<AppState>(AppState.MENU);
const [gameState, setGameState] = useState<AmongUsState>({} as AmongUsState);
const [settingsOpen, setSettingsOpen] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function Overlay() {
}, [gameState.gameState]);

useEffect(() => {
const onOverlaySettings = (_: Electron.IpcRendererEvent, newSettings: any) => {
const onOverlaySettings = (_: Electron.IpcRendererEvent, newSettings: ISettings) => {
setSettings(newSettings);
};

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7867,10 +7867,10 @@ registry-auth-token@^4.0.0:
dependencies:
rc "^1.2.8"

registry-js@^1.12.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/registry-js/-/registry-js-1.12.0.tgz#35ecfba4d3c3777ff1605e239abaa823fa32979f"
integrity sha512-5xk/L83Ph3u7JY+6tb8XrnB78iDoyCwilY4/5C1VhZYiw0jeTUkdTn77kXycWpPK8jQ22LL5DQiAlNcluh+eZw==
registry-js@^1.13.0:
version "1.13.0"
resolved "https://registry.yarnpkg.com/registry-js/-/registry-js-1.13.0.tgz#8c25c83383aad53a295a47f1ac38df6bee0b19c9"
integrity sha512-yFwrYjxVaEopLEXyP5ok7MNKxbi+dKBDLcmDGOO3gb2hISlwBizaQkr0K94xNZn3ovuBMYnTf+D9v+jowmMEng==
dependencies:
nan "^2.14.1"
prebuild-install "^5.3.5"
Expand Down

0 comments on commit 5b88cbd

Please sign in to comment.