//==================================================================================================
// handles the admin permission list
// it will be read in for the list to display when the player displays it to make changes
// please note that the list is purely db based and *not* kept in memory
// it will be cleared once the changes are made
//
void StructureManager::_HandleQueryEntryPermissionData(StructureManagerAsyncContainer* asynContainer,DatabaseResult* result)
{

	PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(asynContainer->mStructureId));

	string playerName;
	DataBinding* binding = mDatabase->CreateDataBinding(1);
	binding->addField(DFT_bstring,0,64);

	uint64 count;
	count = result->getRowCount();
	structure->resetStructureEntryList();
	for(uint64 i = 0;i < count;i++)
	{
		result->GetNextRow(binding,&playerName);

		structure->addStructureEntryListEntry(playerName);

	}

	structure->sendStructureEntryList(asynContainer->mPlayerId);

	mDatabase->DestroyDataBinding(binding);
	
}
Exemplo n.º 2
0
//======================================================================================================================
//
// Modifies the Admin List
//
void	ObjectController::_handleTransferStructure(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
    // requirement we have the structure targeted AND give the name of the recipient on the commandline
    // OR we have the recipient targeted and stand NEXT to the structure were about to transfer

    //do we have a valid donor ?
    CreatureObject* creature  = dynamic_cast<CreatureObject*>(mObject); PlayerObject* player = creature->GetGhost();

    if(!player)
    {
        return;
    }


    // is the player online and near 30m ?
    // we get the  players id as targetid if yes, otherwise we get the name as string
    // however, we do not want players that  are not online

    //now get the target player
    PlayerObject*	recipient	= dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(targetId));

    if(!recipient)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "no_transfer_target"), player);
        return;
    }

    //do we have a valid structure ??? check our target first
    uint64 id = player->GetCreature()->getTargetId();
    Object* object = gWorldManager->getObjectById(id);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    if(!structure)
    {
        // we need to get the nearest structure that we own
        // for now dustoff
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
        return;
    }

    //is the structure in Range???
    float fTransferDistance = gWorldConfig->getConfiguration<float>("Player_Transfer_Structure_Distance",(float)8.0);
    if(glm::distance(player->GetCreature()->mPosition, structure->mPosition) > fTransferDistance)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
        return;
    }

    StructureAsyncCommand command;
    command.PlayerId = player->getId();
    command.StructureId = structure->getId();
    command.RecipientId = recipient->getId();
    command.PlayerStr = recipient->GetCreature()->getFirstName();
    command.Command = Structure_Command_TransferStructure;

    gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

}
Exemplo n.º 3
0
//======================================================================================================================
//
// Modifies the Admin List
//
void	ObjectController::_handleNameStructure(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)

{
    // requirement we have the structure targeted AND give the name of the recipient on the commandline
    // OR we have the recipient targeted and stand NEXT to the structure were about to transfer

    //do we have a valid donor ?
    CreatureObject* creature  = dynamic_cast<CreatureObject*>(mObject); PlayerObject* player = creature->GetGhost();

    if(!player)
    {
        return;
    }

    //do we have a valid structure ??? check our target first
    uint64 id = player->GetCreature()->getTargetId();
    Object* object = gWorldManager->getObjectById(id);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    if(!structure)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
        return;
    }

    //is the structure in Range???
    float fTransferDistance = gWorldConfig->getConfiguration<float>("Player_Structure_Operate_Distance",(float)10.0);
    if(glm::distance(player->GetCreature()->mPosition, structure->mPosition) > fTransferDistance)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
        return;
    }

    //find out where our structure is
    BString dataStr;
    message->getStringUnicode16(dataStr);

    BString nameStr;

    dataStr.convert(BSTRType_ANSI);

    sscanf(dataStr.getAnsi(),"%s",nameStr.getAnsi());

    if(nameStr.getLength() > 68)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "not_valid_name"), player);
        return;
    }

    StructureAsyncCommand command;
    command.Command = Structure_Command_RenameStructure;
    command.PlayerId = player->getId();
    command.StructureId = structure->getId();

    gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

}
Exemplo n.º 4
0
//======================================================================================================================
//
// provides the harvester with the current resources
//
void	ObjectController::_handleHarvesterGetResourceData(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{

    PlayerObject*	player	= dynamic_cast<PlayerObject*>(mObject);

    if(!player)
    {
        return;
    }

    //do we have a valid structure ???
    uint64 id = targetId;
    Object* object = gWorldManager->getObjectById(id);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    if(!structure)
    {
        //gMessageLib->sendSystemMessage(player,L"","player_structure","command_no_building");
        return;
    }

    //is the structure in Range???
    float fTransferDistance = gWorldConfig->getConfiguration<float>("Player_Structure_Operate_Distance",(float)10.0);
    if(glm::distance(player->mPosition, structure->mPosition) > fTransferDistance)
    {
        DLOG(INFO) << " ObjectController::_handleHarvesterGetResourceData Structure not in Range";
        return;
    }

    HarvesterObject* harvester = dynamic_cast<HarvesterObject*>(structure);

    StructureAsyncCommand command;

    command.Command = Structure_Command_GetResourceData;
    command.PlayerId = player->getId();
    command.StructureId = structure->getId();

    gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->getFirstName().getAnsi(),"ADMIN",command);

    return;
    gMessageLib->sendHarvesterResourceData(structure,player);

    DLOG(INFO) << " ObjectController::_handleHarvesterGetResourceData :: hino 7 baseline";
    gMessageLib->sendBaselinesHINO_7(harvester,player);

    //add the structure to the timer so the resource amounts are updated while we look at the hopper
    //harvester->getTTS()->todo		= ttE_UpdateHopper;
    //harvester->getTTS()->playerId	= player->getId();
    //structure->getTTS()->projectedTime = 5000 + Anh_Utils::Clock::getSingleton()->getLocalTime();
    //gStructureManager->addStructureforHopperUpdate(harvester->getId());

    // this needs to be handled zoneserverside - otherwise the addition of a res will trigger a racecondition
    // between the sql write query and the sql read please note that the harvesting itself happens through stored procedures
    // and we cant keep the updatecounters synchronized


}
void StructureManager::_HandleStructureTransferLotsRecipient(StructureManagerAsyncContainer* asynContainer,DatabaseResult* result)
{
	PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(asynContainer->mStructureId));

	PlayerObject* donor = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(asynContainer->mPlayerId));
	PlayerObject* recipient = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(asynContainer->mTargetId));

	uint8 lots;
	DataBinding* binding = mDatabase->CreateDataBinding(1);
	binding->addField(DFT_uint8,0,1);

	uint64 count;
	count = result->getRowCount();
	if(!count)
	{
		gLogger->logMsgF("StructureManager::Transfer Structure Admin List Callback couldnt get recipients lots",MSG_HIGH);
		mDatabase->DestroyDataBinding(binding);			
		return;
	}

	
	//thats lots in use
	result->GetNextRow(binding,&lots);

	uint8 requiredLots = structure->getLotCount();

	uint8 freelots = gWorldConfig->getConfiguration("Player_Max_Lots",(uint8)10) - lots;
	if(freelots >= requiredLots)
	{
		//yay we were succesful
		structure->setOwner(asynContainer->mTargetId);
		mDatabase->ExecuteSqlAsync(0,0,"UPDATE structures SET structures.owner = %I64u WHERE structures.id = %I64u",asynContainer->mTargetId,asynContainer->mStructureId);
		mDatabase->ExecuteSqlAsync(0,0,"DELETE FROM structure_admin_data where playerId = %I64u AND StructureID = %I64u",asynContainer->mPlayerId,asynContainer->mStructureId);
		mDatabase->ExecuteSqlAsync(0,0,"INSERT INTO structure_admin_data VALUES (NULL,%I64u,%I64u,'ADMIN')",asynContainer->mStructureId, asynContainer->mTargetId);
		        

		//update the administration list

		if(donor)
		{
			gMessageLib->sendSystemMessage(donor,L"","player_structure","ownership_transferred_out","",asynContainer->name);
		}
		if(recipient)
		{
			gMessageLib->sendSystemMessage(recipient,L"","player_structure","ownership_transferred_in","",donor->getFirstName().getAnsi());
		}
		

	}
	else
	{
		//say something
	}
	
	mDatabase->DestroyDataBinding(binding);												   	
}
void StructureManager::_HandleStructureDestruction(StructureManagerAsyncContainer* asynContainer,DatabaseResult* result)
{
	struct structData
	{
		uint64 id;
		uint32 condition;
	};

	structData sd;

	DataBinding* binding = mDatabase->CreateDataBinding(2);
	binding->addField(DFT_uint64,offsetof(structData,id),8,0);
	binding->addField(DFT_uint32,offsetof(structData,condition),4,1);

	uint64 count;
	count = result->getRowCount();

	for(uint64 i = 0;i < count;i++)
	{
		result->GetNextRow(binding,&sd);

		PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(sd.id));
		if(structure)
		{
			gLogger->logMsgF("StructureManager::delete structure due to zero condition %I64u",MSG_NORMAL,structure->getId());
			//delete the deed in the db
			//the parent is the structure and the item family is 15
			int8 sql[100];
			sprintf(sql,"DELETE FROM items WHERE parent_id = %"PRIu64" AND item_family = 15",structure->getId());
			mDatabase->ExecuteSqlAsync(NULL,NULL,sql);

			//delete harvester db side with all power and all resources
			gObjectFactory->deleteObjectFromDB(structure);
			UpdateCharacterLots(structure->getOwner());

			//delete it in the world
			gMessageLib->sendDestroyObject_InRangeofObject(structure);
			gWorldManager->destroyObject(structure);


								
		}
	}

	mDatabase->DestroyDataBinding(binding);
}
void StructureManager::handleObjectReady(Object* object,DispatchClient* client)
{
	PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

	if(!structure)
	{
			gLogger->logMsg("StructureManager::handleObjectReady: No structure");
	}

	if(gWorldManager->getWMState() == WMState_Running)
	{
		// set timer for deletion of building fence

		uint32 account = client->getAccountId();
		PlayerObject* player = gWorldManager->getPlayerByAccId(account);

		PlayerStructure* fence =  gNonPersistantObjectFactory->requestBuildingFenceObject(structure->mPosition.x,structure->mPosition.y,structure->mPosition.z, player);
		structure->getTTS()->todo = ttE_BuildingFence;
		structure->getTTS()->buildingFence = fence->getId();
		structure->getTTS()->playerId = player->getId();
		structure->getTTS()->projectedTime = mBuildingFenceInterval + Anh_Utils::Clock::getSingleton()->getLocalTime();

		gWorldManager->handleObjectReady(structure,player->getClient());

		addStructureforConstruction(structure->getId());
	}
	else
	{
		gWorldManager->handleObjectReady(structure,NULL);
	}
}
Exemplo n.º 8
0
//======================================================================================================================
//
// Discards the contents of a harvesters Hopper
//
void	ObjectController::_handleDiscardHopper(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{

    CreatureObject* creature  = dynamic_cast<CreatureObject*>(mObject); PlayerObject* player = creature->GetGhost();

    if(!player)
    {
        return;
    }

    //do we have a valid structure ???
    uint64 id = targetId;
    Object* object = gWorldManager->getObjectById(id);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    if(!structure)
    {
        //gMessageLib->sendSystemMessage(player,L"","player_structure","command_no_building");
        return;
    }

    //is the structure in Range???
    float fTransferDistance = gWorldConfig->getConfiguration<float>("Player_Structure_Operate_Distance",(float)10.0);
    if(glm::distance(player->GetCreature()->mPosition, structure->mPosition) > fTransferDistance)
    {
        return;
    }

    StructureAsyncCommand command;

    command.Command = Structure_Command_DiscardHopper;
    command.PlayerId = player->getId();
    command.StructureId = structure->getId();

    gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);


}
Exemplo n.º 9
0
//======================================================================================================================
//
// Modifies the Admin List
//
void	ObjectController::_handleModifyPermissionList(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)

{

    CreatureObject* creature  = dynamic_cast<CreatureObject*>(mObject); PlayerObject* player = creature->GetGhost();

    if(!player)
    {
        DLOG(info) << " ObjectController::_handleModifyPermissionList Player not found";
        return;
    }

    //find out where our structure is
    BString dataStr;
    message->getStringUnicode16(dataStr);

    BString playerStr,list,action;

    dataStr.convert(BSTRType_ANSI);

    int8 s1[64],s2[32],s3[32];
    sscanf(dataStr.getAnsi(),"%32s %16s %16s",s1, s2, s3);
    playerStr = s1;
    list = s2;
    action = s3;

    if(playerStr.getLength() > 40)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "permission_40_char"), player);
        return;
    }

    //TODO is target a structure?? used when using the commandline option
    uint64 id = player->GetCreature()->getTargetId();
    Object* object = gWorldManager->getObjectById(id);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    //if we have no structure that way, see whether we have a structure were we just used the adminlist
    if(!structure)
    {
        id = player->getStructurePermissionId();
        Object* object = gWorldManager->getObjectById(id);
        structure = dynamic_cast<PlayerStructure*>(object);
    }

    if(!structure)
    {
        return;
    }

    //is the structure in Range???
    float fAdminListDistance = gWorldConfig->getConfiguration<float>("Player_Admin_List_Distance",(float)32.0);

    if(player->getParentId())
    {
        if(CellObject* cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(player->getParentId())))
        {
            if(HouseObject* house = dynamic_cast<HouseObject*>(gWorldManager->getObjectById(cell->getParentId())))
            {
                if(house->getId() != structure->getId())
                {
                    gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
                    return;
                }
            }
        }

    }
    else if(glm::distance(player->GetCreature()->mPosition, structure->mPosition) > fAdminListDistance)
    {
        gMessageLib->SendSystemMessage(::common::OutOfBand("player_structure", "command_no_building"), player);
        return;
    }

    player->setStructurePermissionId(0);

    StructureAsyncCommand command;
    command.PlayerId = player->getId();
    command.StructureId = structure->getId();
    command.List = list;
	command.PlayerStr = playerStr.getAnsi();

    if(action == "add")
    {
        command.Command = Structure_Command_AddPermission;
        gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);
		//addNametoPermissionList(command.StructureId, command.PlayerId, command.PlayerStr, command.List);
    }

    if(action == "remove")
    {
        command.Command = Structure_Command_RemovePermission;
        gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);
    }

}
Exemplo n.º 10
0
void	ObjectController::handleResourceEmptyHopper(Message* message)
{
    uint64 playerId;
    uint64 harvesterId;

    message->getUint64(playerId);
    message->getUint64(harvesterId);

    CreatureObject* creature  = dynamic_cast<CreatureObject*>(mObject); PlayerObject* player = creature->GetGhost();

    if(!player)
    {
        return;
    }

    //do we have a valid structure ???
    Object* object = gWorldManager->getObjectById(harvesterId);
    PlayerStructure* structure = dynamic_cast<PlayerStructure*>(object);

    if(!structure)
    {
        //gMessageLib->sendSystemMessage(player,L"","player_structure","command_no_building");
        return;
    }

    //is the structure in Range???
    float fTransferDistance = gWorldConfig->getConfiguration<float>("Player_Structure_Operate_Distance",(float)10.0);
    if(glm::distance(player->GetCreature()->mPosition, structure->mPosition) > fTransferDistance)
    {
        return;
    }

    uint64 resourceId;
    uint32 amount;
    uint8 b1, b2;

    message->getUint64(resourceId);
    message->getUint32(amount);
    message->getUint8(b1);
    message->getUint8(b2);

    StructureAsyncCommand command;

    if(b1 == 0)
    {
        command.Command		=	Structure_Command_RetrieveResource;
        command.PlayerId	=	player->getId();
        command.StructureId =	structure->getId();
        command.ResourceId	=	resourceId;
        command.Amount		=	amount;
        command.b1 = b1;
        command.b2 = b2;
    }
    if(b1 == 1)
    {
        command.Command		=	Structure_Command_DiscardResource;
        command.PlayerId	=	player->getId();
        command.StructureId =	structure->getId();
        command.ResourceId	=	resourceId;
        command.Amount		=	amount;
        command.b1 = b1;
        command.b2 = b2;

    }

    gStructureManager->checkNameOnPermissionList(structure->getId(),player->getId(),player->GetCreature()->getFirstName(),"HOPPER",command);

}
void StructureManager::_HandleUpdateAttributes(StructureManagerAsyncContainer* asynContainer,DatabaseResult* result)
{
	BString value;
	Type_QueryContainer container;

	DataBinding*	binding = mDatabase->CreateDataBinding(2);
	binding->addField(DFT_bstring,offsetof(Type_QueryContainer,mString),128,0);
	binding->addField(DFT_bstring,offsetof(Type_QueryContainer,mValue),128,1);
	
	PlayerObject* player = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(asynContainer->mPlayerId));
	
	PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(asynContainer->mStructureId));

	uint64 count;
	count = result->getRowCount();

	for(uint64 i = 0;i < count;i++)
	{
		result->GetNextRow(binding,&container);

		if(strcmp(container.mString.getAnsi(),"schematicCustom") == 0)
		{	
			FactoryObject* factory = dynamic_cast<FactoryObject*>(structure);
			if(factory)
				factory->setSchematicCustomName(container.mValue);
			gLogger->logMsgF("StructureManager::GetCustomName : %s",MSG_HIGH, container.mValue.getAnsi());
		}

		if(strcmp(container.mString.getAnsi(),"schematicName") == 0)
		{	
			FactoryObject* factory = dynamic_cast<FactoryObject*>(structure);
			if(factory)
				factory->setSchematicName(container.mValue);
			gLogger->logMsgF("StructureManager::GetName : %s",MSG_HIGH, container.mValue.getAnsi());
		}

		if(strcmp(container.mString.getAnsi(),"schematicFile") == 0)
		{	
			FactoryObject* factory = dynamic_cast<FactoryObject*>(structure);
			if(factory)
				factory->setSchematicFile(container.mValue);
			gLogger->logMsgF("StructureManager::GetNameFile : %s",MSG_HIGH, container.mValue.getAnsi());
		}

		if(strcmp(container.mString.getAnsi(),"maintenance") == 0)
		{

			if(structure->hasAttribute("examine_maintenance"))
			{
				structure->setAttribute("examine_maintenance",container.mValue.getAnsi());
			}
			else
			{
				structure->addAttribute("examine_maintenance",container.mValue.getAnsi());
			}
		}

		if(strcmp(container.mString.getAnsi(),"power") == 0)
		{

			if(structure->hasAttribute("examine_power"))
			{
				structure->setAttribute("examine_power",container.mValue.getAnsi());
			}
			else
			{
				structure->addAttribute("examine_power",container.mValue.getAnsi());
			}

		}

		if(strcmp(container.mString.getAnsi(),"condition") == 0)
		{

			
			container.mValue.setLength(4);
			structure->setDamage(boost::lexical_cast<uint32>(container.mValue.getAnsi()));
			gLogger->logMsgF("StructureManager::GetConditionData : %u",MSG_HIGH, structure->getDamage());
		}

		if(strcmp(container.mString.getAnsi(),"name") == 0)
		{

			structure->setOwnersName(container.mValue);
			
		}
	}

	switch(asynContainer->command.Command)
	{
		case Structure_Command_AccessSchem:
		{
			FactoryObject* factory = dynamic_cast<FactoryObject*>(structure);
			if(factory)
				createNewFactorySchematicBox(player, factory);
		}
		break;

		case Structure_Command_Destroy:
		{
			structure->deleteStructureDBDataRead(player->getId());
		}
		break;

		case Structure_Command_DepositPower:
		{
			createPowerTransferBox(player,structure);
		}
		break;

		case Structure_Command_PayMaintenance:
		{
			createPayMaintenanceTransferBox(player,structure);
		}
		break;

		case Structure_Command_ViewStatus:
		{
			createNewStructureStatusBox(player, structure);
		}
		break;

		default:
			break;
	}		
	
	mDatabase->DestroyDataBinding(binding);												   	


}
Exemplo n.º 12
0
void HarvesterObject::handleObjectMenuSelect(uint8 messageType,Object* srcObject)
{
    PlayerObject* player = dynamic_cast<PlayerObject*>(srcObject);
    if(!player)
    {
        return;
    }

    switch(messageType)
    {
    case radId_StructureStatus:
    {
        StructureAsyncCommand command;
        command.Command = Structure_Command_ViewStatus;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

    }
    break;

    case radId_depositPower:
    {
        StructureAsyncCommand command;
        command.Command = Structure_Command_DepositPower;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

    }
    break;

    case radId_payMaintenance:
    {
        StructureAsyncCommand command;
        command.Command = Structure_Command_PayMaintenance;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

    }
    break;

    case radId_serverTerminalManagementDestroy:
    {
        StructureAsyncCommand command;
        command.Command = Structure_Command_Destroy;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);

    }
    break;
    case radId_serverTerminalPermissionsAdmin:
    {
        PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(this->getId()));
		
		if(structure->getAdminData().check_admin(player->getId()))	{
			structure->sendStructureAdminList(player->getId());
		}

    }
    break;

    case radId_serverTerminalPermissionsHopper:
    {
		PlayerStructure* structure = dynamic_cast<PlayerStructure*>(gWorldManager->getObjectById(this->getId()));
		
		if(structure->getAdminData().check_admin(player->getId()))	{
			structure->sendStructureHopperList(player->getId());
		}

    }
    break;

    case radId_setName:
    {

        StructureAsyncCommand command;
        command.Command = Structure_Command_RenameStructure;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"ADMIN",command);


    }
    break;

    case radId_operateHarvester:
    {
        StructureAsyncCommand command;
        command.Command = Structure_Command_OperateHarvester;
        command.PlayerId = player->getId();
        command.StructureId = this->getId();

        gStructureManager->checkNameOnPermissionList(this->getId(),player->GetCreature()->getId(),player->GetCreature()->getFirstName(),"HOPPER",command);

    }
    break;

    }
}