change folder name
This commit is contained in:
14
src/commands/SetNameCommand.cpp
Normal file
14
src/commands/SetNameCommand.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "Command.h"
|
||||
|
||||
#include "../core/Components.h"
|
||||
|
||||
void SetNameCommand::execute(GameServer *server)
|
||||
{
|
||||
entityx::Entity entity = server->serverToEntityX.at(m_clientIndex);
|
||||
entityx::ComponentHandle<NetworkPlayerProperties> playerproperties = entity.component<NetworkPlayerProperties>();
|
||||
if (playerproperties)
|
||||
{
|
||||
playerproperties->name = m_name;
|
||||
}
|
||||
std::cout << "Entity name changed to " << playerproperties->name << " Buffer content: " << m_name << std::endl;
|
||||
}
|
||||
Reference in New Issue
Block a user