Server sends character create & delete messages
This commit is contained in:
@@ -169,32 +169,5 @@ void ServerApplication::CleanupLostConnection(int clientIndex) {
|
||||
std::cout << clientMgr.GetLoadedCount() << " clients and " << accountMgr.GetLoadedCount() << " accounts total" << std::endl;
|
||||
}
|
||||
|
||||
//SET: utility/delete
|
||||
void ServerApplication::PumpCharacterUnload(int uid) {
|
||||
//delete the client-side character(s)
|
||||
//NOTE: This is a strange function
|
||||
CharacterPacket newPacket;
|
||||
newPacket.type = SerialPacketType::CHARACTER_DELETE;
|
||||
newPacket.characterIndex = uid;
|
||||
PumpPacket(static_cast<SerialPacket*>(&newPacket));
|
||||
}
|
||||
|
||||
//SET: utility/delete
|
||||
void ServerApplication::CopyCharacterToPacket(CharacterPacket* const packet, int characterIndex) {
|
||||
CharacterData* character = characterMgr.Get(characterIndex);
|
||||
if (!character) {
|
||||
throw(std::runtime_error("Failed to copy a character to a packet"));
|
||||
}
|
||||
|
||||
//TODO: keep this up to date when the character changes
|
||||
packet->characterIndex = characterIndex;
|
||||
strncpy(packet->handle, character->GetHandle().c_str(), PACKET_STRING_SIZE);
|
||||
strncpy(packet->avatar, character->GetAvatar().c_str(), PACKET_STRING_SIZE);
|
||||
packet->accountIndex = character->GetOwner();
|
||||
packet->roomIndex = character->GetRoomIndex();
|
||||
packet->origin = character->GetOrigin();
|
||||
packet->motion = character->GetMotion();
|
||||
}
|
||||
|
||||
//TODO: remove this terminate comment
|
||||
//*/
|
||||
Reference in New Issue
Block a user