Skip to content

Conversation

@Skyaero42
Copy link

@Skyaero42 Skyaero42 commented May 15, 2025

The chat toggle function is blocked by a the isActivePlayer check, which checks if a player is either an observer or dead (note that an observer is also classified as a 'dead' player).

I have not removed this check from team chat functionality (backspace), because observers are not in a team. Observer messages are never send to active players anyways. There is a safeguard for that further on in the chat logic.

An additional blocker prevented the observer chat to work after surrender. The player template is changed to observer and resets a number of data entries related to network information. This information is used to determine the value of player->IsMultiplayer(), causing it to return false. The chat function uses this to check if chat can be enabled. This is resolved by adding an entry that checks if the player is dead

@Skyaero42 Skyaero42 self-assigned this May 15, 2025
@Skyaero42 Skyaero42 added Enhancement Is new feature or request Gen Relates to Generals ZH Relates to Zero Hour labels May 15, 2025
@Mauller
Copy link

Mauller commented May 15, 2025

Does this work, because i also came across this in commandbarobserver

//	if( controlID == buttonCommunicator && TheGameLogic->getGameMode() == GAME_INTERNET )
/*
{
	popupCommunicatorLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupCommunicator.wnd" ) );
	popupCommunicatorLayout->runInit();
	popupCommunicatorLayout->hide( FALSE );
	popupCommunicatorLayout->bringForward();
}
*/

That is commented out. It might just be that the communicator button is disabled without this.

@Skyaero42 Skyaero42 marked this pull request as draft May 15, 2025 20:08
@Skyaero42 Skyaero42 marked this pull request as ready for review May 15, 2025 20:34
@Skyaero42
Copy link
Author

Does this work, because i also came across this in commandbarobserver

//	if( controlID == buttonCommunicator && TheGameLogic->getGameMode() == GAME_INTERNET )
/*
{
	popupCommunicatorLayout = TheWindowManager->winCreateLayout( AsciiString( "Menus/PopupCommunicator.wnd" ) );
	popupCommunicatorLayout->runInit();
	popupCommunicatorLayout->hide( FALSE );
	popupCommunicatorLayout->bringForward();
}
*/

That is commented out. It might just be that the communicator button is disabled without this.

Communicator button is only used to view players and mute them. Chat is only available through enter or (for team players) backspace.

@xezon xezon added the Minor Severity: Minor < Major < Critical < Blocker label May 16, 2025
@xezon xezon changed the title [GEN][ZH] Enable chat function for observer (#863) [GEN][ZH] Enable chat function for match observers May 16, 2025
@xezon xezon added the Do Later Work on this later label May 25, 2025
@xezon
Copy link

xezon commented May 31, 2025

GenTool touches 5 locations to properly unlock this. This change only touches 1. I suspect this change is incomplete. I could be wrong.

@Mauller
Copy link

Mauller commented Jun 2, 2025

GenTool touches 5 locations to properly unlock this. This change only touches 1. I suspect this change is incomplete. I could be wrong.

@roossienb did test this with the game running on two different computers.

@Skyaero42
Copy link
Author

I did work in-game and in the game-join menu. Can't remember if I checked the score-screen. Nobody every chats in that one. Will check again

@xezon
Copy link

xezon commented Jun 2, 2025

Nevermind, I confused this with the Control Bar toggle.

@xezon
Copy link

xezon commented Jul 3, 2025

GenTool enables these things:

0x5AE45C > NOP 8 bytes to enable Observer HUD
0x5ED4B5 > NOP 12 bytes to enable Observer Backspace Button
0x5ED509 > NOP 12 bytes to enable Observer Enter Button
0x5ADE51 > NOP 8 bytes to enable Observer Chat after Surrender
0x5EE7A6 > NOP 8 bytes to enable Observer Diplomacy Screen after Surrender

@xezon xezon removed the Do Later Work on this later label Jul 3, 2025
@xezon
Copy link

xezon commented Jul 8, 2025

This change is incomplete.

After Surrender, it is not possible to Chat. It is also not possible to open the Diplomacy Screen (Tab button).

GenTool also allows to chat with Backspace button as Observer. I cannot recall if this allows to chat to former team mates that are now Observer. Probably not. If it does not do anything other than ENTER chat, then its fine to keep Backspace disabled for Observers.

I cannot remember what the "enable Observer HUD" is supposed to mean. I tested in GenTool and I do not see what that is supposed to do.

@Skyaero42 Skyaero42 force-pushed the fix/observer-cannot-chat branch from 3a6f054 to b9e5cbf Compare July 10, 2025 19:17
@Skyaero42
Copy link
Author

I've updated the start post with the fixes. There are three locations that I needed to fix.

As explained in the start post, I have not enabled backspace, because by design, an observer cannot send messages to active players.

I don't know what enable Observer HUD is either, so cannot search for it.

@xezon
Copy link

xezon commented Jul 10, 2025

As explained in the start post, I have not enabled backspace, because by design, an observer cannot send messages to active players.

Did you check if Observer Team chat would chat to former Allies that have also turned Observer?

@Skyaero42
Copy link
Author

As explained in the start post, I have not enabled backspace, because by design, an observer cannot send messages to active players.

Did you check if Observer Team chat would chat to former Allies that have also turned Observer?

A player that gets killed gets kicked out of the team. The game does not remember past teams and does not recreate teams in observer mode. Team relationships are not present in observer mode, hence team chat doesn't work - even if the chat popup would be enabled. The message simply doesn't get send, because there are no players to send to.

@xezon
Copy link

xezon commented Jul 11, 2025

That makes sense.

@Skyaero42
Copy link
Author

So I think this is ready for merging, or is there anything else that needs to be checked/done?

@Skyaero42 Skyaero42 force-pushed the fix/observer-cannot-chat branch from 4aa71a2 to 3056ab9 Compare July 19, 2025 19:38
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good.

@xezon xezon changed the title [GEN][ZH] Enable chat function for match observers [GEN][ZH] Enable Chat for Observers Jul 20, 2025
@xezon xezon changed the title [GEN][ZH] Enable Chat for Observers [GEN][ZH] Enable Global Chat for Observers Jul 20, 2025
@xezon xezon changed the title [GEN][ZH] Enable Global Chat for Observers [GEN][ZH] Enable Chat for Observers Jul 20, 2025
@xezon xezon merged commit 3f85acb into TheSuperHackers:main Jul 20, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Observer cannot use chat functionality

3 participants