From 5e0570365607d5bc58272b908bb0f839d9be1dce Mon Sep 17 00:00:00 2001 From: Denoflions Date: Thu, 17 Jun 2021 05:55:04 -0400 Subject: [PATCH] Its been a long night... --- package.json | 2 +- src/OotOnline/WorldEvents/WorldEvents.ts | 8 +++----- src/OotOnline/package.json | 4 ++-- update.json | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 20c4b197..782875ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "OotOnline", - "version": "3.0.65", + "version": "3.0.66", "description": "Template base for making [ModLoader64](https://github.com/hylian-modding/ModLoader64) Plugins.", "main": "index.js", "scripts": { diff --git a/src/OotOnline/WorldEvents/WorldEvents.ts b/src/OotOnline/WorldEvents/WorldEvents.ts index 07596f70..e77e2c65 100644 --- a/src/OotOnline/WorldEvents/WorldEvents.ts +++ b/src/OotOnline/WorldEvents/WorldEvents.ts @@ -176,8 +176,8 @@ export class WorldEventRewards { if (verified) { this.ModLoader.logger.debug("Rewards file OK."); } else { - this.rewardContainer = { tickets: [], coins: 0, sig: Buffer.alloc(1), externalData: {} }; - this.ModLoader.logger.error("This rewards file has been tampered with."); + //this.rewardContainer = { tickets: [], coins: 0, sig: Buffer.alloc(1), externalData: {} }; + this.ModLoader.logger.error("This rewards file has an invalid signature."); } } } @@ -623,11 +623,9 @@ export class WorldEventRewards { @NetworkHandler('WorldEvents_TransactionPacket') onTransaction(packet: WorldEvents_TransactionPacket) { - let obj: any = { tickets: this.rewardContainer.tickets, coins: this.rewardContainer.coins }; - let hash: string = this.ModLoader.utils.hashBuffer(Buffer.from(JSON.stringify(obj))); const public_key = publicKey; const verifier = crypto.createVerify('sha256'); - verifier.update(Buffer.from(hash)); + verifier.update(Buffer.from(packet.hash)); verifier.end(); const verified = verifier.verify(public_key, packet.sig); if (verified) { diff --git a/src/OotOnline/package.json b/src/OotOnline/package.json index dd3af046..7baf4702 100644 --- a/src/OotOnline/package.json +++ b/src/OotOnline/package.json @@ -1,7 +1,7 @@ { "name": "OotOnline", - "version": "3.0.65", - "date": "Thu, 17 Jun 2021 06:30:06 GMT", + "version": "3.0.66", + "date": "Thu, 17 Jun 2021 09:45:20 GMT", "description": "", "main": "OotOnline.js", "author": "denoflions", diff --git a/update.json b/update.json index 0be34465..48ae2d44 100644 --- a/update.json +++ b/update.json @@ -1,5 +1,5 @@ { - "version": "3.0.65", + "version": "3.0.66", "url": "https://repo.modloader64.com/mods/Ooto/update/OotOnline.pak", "devurl": "https://repo.modloader64.com/mods/Ooto/dev/OotOnline.pak" } \ No newline at end of file