From b4ebad503e696e711c062fe2d372d29b4cad3f5e Mon Sep 17 00:00:00 2001 From: lahirumenik <115687865+lahirumenik@users.noreply.github.com> Date: Mon, 29 Jan 2024 02:27:14 +0530 Subject: [PATCH 1/2] gun socket tested complete --- backend/serverless/Lambda/gunsocket.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/serverless/Lambda/gunsocket.js b/backend/serverless/Lambda/gunsocket.js index cc0c595..977e7bb 100644 --- a/backend/serverless/Lambda/gunsocket.js +++ b/backend/serverless/Lambda/gunsocket.js @@ -25,6 +25,7 @@ exports.handler = async (event, context) => { "gunid": {"S": gunid}, } + }; @@ -51,7 +52,7 @@ exports.handler = async (event, context) => { const gyrosocketmsg =JSON.stringify({ - "gyrox": gyrox, + // "gyrox": gyrox, "gyroy": gyroy }) const shootsocketmsg =JSON.stringify({ From ce84333cabe58b5e2d5bc7f5b46dd17e2ba39d6e Mon Sep 17 00:00:00 2001 From: lahirumenik <115687865+lahirumenik@users.noreply.github.com> Date: Mon, 29 Jan 2024 04:58:19 +0530 Subject: [PATCH 2/2] health ammo debugged --- backend/serverless/Lambda/healthammo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/serverless/Lambda/healthammo.js b/backend/serverless/Lambda/healthammo.js index d15e9a7..09ed930 100644 --- a/backend/serverless/Lambda/healthammo.js +++ b/backend/serverless/Lambda/healthammo.js @@ -11,9 +11,9 @@ const client = new ApiGatewayManagementApiClient({ endpoint: ENDPOINT }); exports.handler = async (event, context) => { try { const result = event; - const ammo = result.ammo; - const health = result.health; - const gunid = fireresult.ssid; + const ammo = result.Ammo; + const health = result.Health; + const gunid = result.SSID; var numericPart = gunid[3]; var topic = "gun/"+numericPart+"/healthammo"; @@ -33,7 +33,7 @@ exports.handler = async (event, context) => { const command = new PublishCommand(input); - const response = await client.send(command) + const response = await iotclient.send(command) const playerParams = { "TableName": 'arcombat-gunid',