runejs / server

RuneJS is a RuneScape game server written in TypeScript and JavaScript. The goal of the project is to create a comprehensive game engine, while also providing simple and easy to use content development systems and APIs.
GNU General Public License v3.0
244 stars 83 forks source link

fix: initialise `metadata` within Player #377

Closed Jameskmonger closed 2 years ago

Jameskmonger commented 2 years ago

Fixes an issue introduced in #376

Issue manifested as follows (reported by Raph on discord)

[2] [2022-09-13T01:55:22.550Z] ERROR (16960 on desktop-raph): Cannot read property 'configs' of undefined
[2]     TypeError: Cannot read property 'configs' of undefined
[2]         at OutboundPacketHandler.updateClientConfig (C:\Users\raphp\source\repos\runejs-server\src\engine\net\outbound-packet-handler.ts:282:22)
[2]         at Player.updateQuestTab (C:\Users\raphp\source\repos\runejs-server\src\engine\world\actor\player\player.ts:1166:30)
[2]         at Player.init (C:\Users\raphp\source\repos\runejs-server\src\engine\world\actor\player\player.ts:241:14)
[2]         at GatewayServer.createPlayer (C:\Users\raphp\source\repos\runejs-server\src\server\gateway\gateway-server.ts:181:22)
[2]         at GatewayServer.parseLoginServerResponse (C:\Users\raphp\source\repos\runejs-server\src\server\gateway\gateway-server.ts:130:36)
[2]         at Socket.<anonymous> (C:\Users\raphp\source\repos\runejs-server\src\server\gateway\gateway-server.ts:66:22)
[2]         at Socket.emit (events.js:400:28)
[2]         at addChunk (internal/streams/readable.js:293:12)
[2]         at readableAddChunk (internal/streams/readable.js:267:9)
[2]         at Socket.Readable.push (internal/streams/readable.js:206:10)
[2] [2022-09-13T01:55:22.552Z] INFO (16960 on desktop-raph): Connection destroyed.
[2] [2022-09-13T01:55:22.553Z] INFO (16960 on desktop-raph): raph has logged out.
SchauweM commented 2 years ago

My fault for not checking a clean install.