Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const DesignChangedPacket = require("../Packets/DesignChanged");
|
||||
const packet_255 = require("../Packets/packet_255");
|
||||
|
||||
module.exports = function (ws, message, player) {
|
||||
const designID = message.getUint16(1);
|
||||
|
||||
const newDesignID = player.setDesign(designID);
|
||||
if (!newDesignID) {
|
||||
const packet = packet_255({ packetId: 40, isSuccessful: Boolean(newDesignID) })
|
||||
return player.map.registerIndividualNetworkPacket(player.id, packet);
|
||||
};
|
||||
|
||||
//setTimeout(() => {
|
||||
const data = {
|
||||
typeID: player.typeID,
|
||||
id: player.id,
|
||||
designID
|
||||
};
|
||||
|
||||
const packet = DesignChangedPacket(data);
|
||||
player.map.registerNetworkPacket(player.id, packet);
|
||||
//}, 3000);
|
||||
};
|
||||
Reference in New Issue
Block a user