Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the CeeCloudServer, add this to the main.js file, before the serverInstance.start(); line:

Code Block
languagejs
serverInstance.addCustomPacketHandler("GetCustomData", (packetData, callback) => {

    console.log(`packetData: incomingPacketName:${packetData.incomingPacketName}, 
              incomingData: ${JSON.stringify(packetData.incomingData, null, 2)},
              modelKey: ${packetData.modelKey}, fullModelFileName: ${packetData.fullModelFileName}`);

    const customData = { myValue: 123, myString: "ABC" };
    callback("CustomDataResponse", customData);
});

...