<commit_before>/*
 * LightsaberCrystalComponentImplementation.cpp
 *
 *      Author: Katherine
 */

#include "engine/engine.h"


#include "server/zone/objects/tangible/component/Component.h"
#include "server/zone/objects/player/sui/messagebox/SuiMessageBox.h"
#include "server/zone/objects/tangible/component/lightsaber/LightsaberCrystalComponent.h"
#include "server/zone/packets/object/ObjectMenuResponse.h"
#include "server/zone/templates/tangible/LightsaberCrystalObjectTemplate.h"
#include "server/zone/packets/scene/AttributeListMessage.h"
#include "server/zone/objects/player/PlayerObject.h"
#include "server/zone/objects/player/sui/callbacks/LightsaberCrystalTuneSuiCallback.h"

void LightsaberCrystalComponentImplementation::initializeTransientMembers() {
	ComponentImplementation::initializeTransientMembers();

	setLoggingName("LightsaberCrystalComponent");

}

void LightsaberCrystalComponentImplementation::loadTemplateData(SharedObjectTemplate* templateData) {
	TangibleObjectImplementation::loadTemplateData(templateData);

	lcoTemplate = dynamic_cast<LightsaberCrystalObjectTemplate*>(templateData);

	postTuneName = lcoTemplate->getPostTunedName();
}

void LightsaberCrystalComponentImplementation::fillAttributeList(AttributeListMessage* alm, CreatureObject* object) {
	TangibleObjectImplementation::fillAttributeList(alm, object);

	if (owner == ""){
		StringBuffer str;
		str << "\\#FF6600" << "UNTUNED" ;
		alm->insertAttribute("crystal_owner", str);
	} else {
		alm->insertAttribute("crystal_owner", owner);
	}


	if (getColor() != 31){
		StringBuffer str;
		str << "@jedi_spam:saber_color_" << getColor();
		alm->insertAttribute("color", str);
	}

	PlayerObject* player = object->getPlayerObject();
	if (player->getJediState() > 1){

		if (getColor() == 31){<commit_msg>[fixed] only jedi and admins can see if a crystal/pearl is tuned & owner of it. [fixed] only jedi and admins can see the stats of tuned crystals/pearls.<commit_after>/*
 * LightsaberCrystalComponentImplementation.cpp
 *
 *      Author: Katherine
 */

#include "engine/engine.h"


#include "server/zone/objects/tangible/component/Component.h"
#include "server/zone/objects/player/sui/messagebox/SuiMessageBox.h"
#include "server/zone/objects/tangible/component/lightsaber/LightsaberCrystalComponent.h"
#include "server/zone/packets/object/ObjectMenuResponse.h"
#include "server/zone/templates/tangible/LightsaberCrystalObjectTemplate.h"
#include "server/zone/packets/scene/AttributeListMessage.h"
#include "server/zone/objects/player/PlayerObject.h"
#include "server/zone/objects/player/sui/callbacks/LightsaberCrystalTuneSuiCallback.h"

void LightsaberCrystalComponentImplementation::initializeTransientMembers() {
	ComponentImplementation::initializeTransientMembers();

	setLoggingName("LightsaberCrystalComponent");

}

void LightsaberCrystalComponentImplementation::loadTemplateData(SharedObjectTemplate* templateData) {
	TangibleObjectImplementation::loadTemplateData(templateData);

	lcoTemplate = dynamic_cast<LightsaberCrystalObjectTemplate*>(templateData);

	postTuneName = lcoTemplate->getPostTunedName();
}

void LightsaberCrystalComponentImplementation::fillAttributeList(AttributeListMessage* alm, CreatureObject* object) {
	TangibleObjectImplementation::fillAttributeList(alm, object);
	PlayerObject* player = object->getPlayerObject();

	if (player->getJediState() > 1 || player->isPrivileged()){	
	
		if (getColor() == 31){
			if (owner == ""){
				StringBuffer str;
				str << "\\#FF6600" << "UNTUNED" ;
				alm->insertAttribute("crystal_owner", str);
			} else {
				alm->insertAttribute("crystal_owner", owner);
			}
		}		
	
	}

	if (getColor() != 31){
		StringBuffer str;
		str << "@jedi_spam:saber_color_" << getColor();
		alm->insertAttribute("color", str);
	}

	if (player->getJediState() > 1 || player->isPrivileged()){

		if (getColor() == 31){
{'fraction_non_alphanumeric': 0.13001813001813, 'fraction_numerical': 0.005439005439005439, 'mean_word_length': 6.802020202020202, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3409092', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1191, 'n_words': 177}