Browse Source

AFK Visual for players now works for newer clients (1188+)

Image 1 year ago
parent
commit
3ef309619f

+ 4 - 4
EQ2/source/WorldServer/Commands/Commands.cpp

@@ -4161,8 +4161,8 @@ void Commands::Command_AFK(Client* client, Seperator* sep)
 
 	if (player->get_character_flag(CF_AFK))
 	{
-		LogWrite(MISC__TODO, 1, "TODO", "player->SetActivityStatus(player->GetActivityStatus() + ACTIVITY_STATUS_AFK); <-- need to find this");
-		/*player->SetActivityStatus(player->GetActivityStatus() + ACTIVITY_STATUS_AFK); <-- need to find this */
+		//LogWrite(MISC__TODO, 1, "TODO", "player->SetActivityStatus(player->GetActivityStatus() + ACTIVITY_STATUS_AFK); <-- need to find this");
+		player->SetActivityStatus(player->GetActivityStatus() + ACTIVITY_STATUS_AFK);
 
 		if (sep && sep->argplus[0])
 			player->SetAwayMessage("I am away from the keyboard, " + string(sep->argplus[0]));
@@ -4181,8 +4181,8 @@ void Commands::Command_AFK(Client* client, Seperator* sep)
 
 		player->GetZone()->SimpleMessage(CHANNEL_COLOR_YELLOW, message.c_str(), player, 30);
 	}
-	/*else
-		player->SetActivityStatus(player->GetActivityStatus() - ACTIVITY_STATUS_AFK); <-- need to find this */
+	else
+		player->SetActivityStatus(player->GetActivityStatus() - ACTIVITY_STATUS_AFK);
 }
 
 /* 

+ 10 - 0
EQ2/source/WorldServer/Spawn.cpp

@@ -2063,12 +2063,22 @@ void Spawn::InitializeInfoPacketData(Player* spawn, PacketStruct* packet){
 		if ((appearance.activity_status & ACTIVITY_STATUS_IMMUNITY_REMAINING) > 0)
 			temp_activity_status += ACTIVITY_STATUS_IMMUNITY_REMAINING_1188;
 
+		if ((appearance.activity_status & ACTIVITY_STATUS_AFK) > 0)
+			temp_activity_status += ACTIVITY_STATUS_AFK_1188;
+
 		if (EngagedInCombat())
 			temp_activity_status += ACTIVITY_STATUS_INCOMBAT_1188;
 	}
 	else
+	{
 		temp_activity_status = appearance.activity_status;
 
+		// WE ARE UNSURE OF THESE OLD CLIENT VALUES USED AS TEMP PLACEHOLDERS FOR NEWER CLIENTS
+		if ((appearance.activity_status & ACTIVITY_STATUS_AFK) > 0)
+			temp_activity_status -= ACTIVITY_STATUS_AFK;
+
+	}
+
 	packet->setDataByName("activity_status", temp_activity_status); //appearance.activity_status);
 
 	// If player and player has a follow target

+ 2 - 0
EQ2/source/WorldServer/Spawn.h

@@ -110,6 +110,8 @@
 #define ACTIVITY_STATUS_SOLID				64 //used by zone objects to remain solid
 #define ACTIVITY_STATUS_IMMUNITY_GAINED		8192
 #define ACTIVITY_STATUS_IMMUNITY_REMAINING	16384
+// WE ARE UNSURE OF THESE OLD CLIENT VALUES USED AS TEMP PLACEHOLDERS FOR NEWER CLIENTS
+#define ACTIVITY_STATUS_AFK					32768 // whats the real one?
 
 #define ACTIVITY_STATUS_MERCENARY_1188				1<<2
 #define ACTIVITY_STATUS_STATICOBJECT_1188			1<<3