Im trying to build a small application in which I run a dedicated server and I have two clients with a simple hud.
This hud is made with two buttons.
"Join blue team" "Join red team"
When they press one of the two they will swap their hud to the specific one depending on the blue and the red one.
that is how it should work.
But right now, if I press in one client "red" and in the other "Blue" one of the two clients receive both HUDs and the other none. Also I print one message "Button clicked!" and every time one of the two press it both receive the message.
The code is like that:
`void SDB_XWidget::Construct(const FArguments& InArgs)
OwnerHUD = InArgs._OwnerHUD;
CurrentPlayerController = Cast<ADB_XPlayerController>(OwnerHUD->PlayerOwner);
FightContainer = SNew(SHorizontalBox);
.OnClicked(this, &SDB_XWidget::HUDDefaultBehaviour, EHUDState::HUD_Construct)
.OnClicked(this, &SDB_XWidget::HUDDefaultBehaviour, EHUDState::HUD_Basic)
Method that gets called on clicked
FReply SDB_XWidget::HUDDefaultBehaviour(EHUDState NewHUDState)
CurrentPlayerController->OwnTeam = EPlayerTurn::T_P1;
CurrentPlayerController->OwnTeam = EPlayerTurn::T_P2;
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Button Clicked!"));
None of this method is Server / Client only, or anything like that. I believe that may be the issue but I don´t quite understand why since this is a particular thing that only the client should care about.
Can anybody help me with this?
Jul 14 '15 at 01:24 AM
in C++ Programming