Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const packet_255 = require("../Packets/packet_255");
|
||||
|
||||
module.exports = function (ws, message, player) {
|
||||
let isRepairSuccessful = null;
|
||||
|
||||
if (player.isRepairing()) {
|
||||
player.cancelRepair();
|
||||
isRepairSuccessful = false;
|
||||
} else {
|
||||
player.initializeRepair();
|
||||
isRepairSuccessful = true;
|
||||
};
|
||||
|
||||
const packet = packet_255({ packetId: 14, isSuccessful: isRepairSuccessful });
|
||||
ws.send(packet, true, true); // should use central packet distributor
|
||||
|
||||
const metadata = [player.hp.current / player.hp.maximum, player.isAttacking()];
|
||||
|
||||
return metadata;
|
||||
};
|
||||
Reference in New Issue
Block a user