if (packetID == TilePacketType.TOGGLE_MODE.ordinal())
{
if (this.getManipulatingCard() != null)
{
ICardIdentification idCard = (ICardIdentification) this.getManipulatingCard().getItem();
int id = dataStream.readInt();
Permission permission = Permission.getPermission(id);
if (permission != null)
{
if (!idCard.hasPermission(this.getManipulatingCard(), permission))
{
idCard.addPermission(this.getManipulatingCard(), permission);
}
else
{
idCard.removePermission(this.getManipulatingCard(), permission);
}
}
else
{
ModularForceFieldSystem.LOGGER.severe("Error handling security station permission packet: " + id + " - " + permission);
}
}
}
else if (packetID == TilePacketType.STRING.ordinal())
{
if (this.getManipulatingCard() != null)
{
ICardIdentification idCard = (ICardIdentification) this.getManipulatingCard().getItem();
idCard.setUsername(this.getManipulatingCard(), dataStream.readUTF());
}
}
}