Network Player controller provides functionality for client-server. Major functionalites are.
More...
#include <RRNetworkPlayerController.h>
|
| ARRNetworkPlayerController () |
|
virtual void | Tick (float DeltaSeconds) override |
|
void | GetLifetimeReplicatedProps (TArray< FLifetimeProperty > &OutLifetimeProps) const override |
| Returns the properties used for network replication, this needs to be overridden by all actor classes with native. More...
|
|
virtual void | OnRep_SimStateClient () |
| Function called with #SimStateClient replication. Initialize ROS2SimStateClient. More...
|
|
void | CreateROS2SimStateClient (const TSubclassOf< URRROS2SimulationStateClient > &InSimStateClientClass) |
| Create ROS2SimStateClient without initializing yet. More...
|
|
void | ClientInitSimStateClientROS2 () |
| Init SimStateClient ROS 2 Component, e.g. SimStateClientROS2Node, SimStateClientClockPublisher. More...
|
|
void | ServerSetPlayerName (const FString &InPlayerName) |
| Set player name in server. More...
|
|
virtual float | GetLocalTime () |
|
void | RequestServerTimeUpdate () |
| [Time Sync Step1] Request server time update from client via ServerRequestLocalClockUpdate More...
|
|
void | ServerRequestLocalClockUpdate (float InClientRequestTime) |
| [Time Sync Step2] Called from the client and execute in the server via RPC. More...
|
|
void | ClientSendLocalClockUpdate (float InClientRequestTime, float InServerCurrentTime) |
| [Time Sync Step3] Called from the server and execute in the client via RPC. More...
|
|
void | UpdateLocalClock (float InDeltaSeconds) |
| Increase local clock's time by delta seconds. More...
|
|
virtual void | ServerSetLinearVel (ARRBaseRobot *InServerRobot, float InClientTimeStamp, const FTransform &InClientRobotTransform, const FVector &InLinearVel) |
| Set server linear velocity to #RobotVehicleMoveComponent. Non player object can use this method to call RPC. More...
|
|
virtual void | ServerSetAngularVel (ARRBaseRobot *InServerRobot, float InClientTimeStamp, const FRotator &InClientRobotRotation, const FVector &InAngularVel) |
| Set server angular velocity to #RobotVehicleMoveComponent. Non player object can use this method to call RPC. More...
|
|
|
virtual void | BeginPlay () override |
| Standalone game mode will call this method to call #ClientInitSimStateClientROS2lient. More...
|
|
virtual void | ReceivedPlayer () override |
|
Network Player controller provides functionality for client-server. Major functionalites are.
UCLASS()
◆ ARRNetworkPlayerController()
ARRNetworkPlayerController::ARRNetworkPlayerController |
( |
| ) |
|
◆ BeginPlay()
virtual void ARRNetworkPlayerController::BeginPlay |
( |
| ) |
|
|
overrideprotectedvirtual |
Standalone game mode will call this method to call #ClientInitSimStateClientROS2lient.
Client server game mode will start timer to sync time with server.
◆ ClientInitSimStateClientROS2()
void ARRNetworkPlayerController::ClientInitSimStateClientROS2 |
( |
| ) |
|
◆ ClientSendLocalClockUpdate()
void ARRNetworkPlayerController::ClientSendLocalClockUpdate |
( |
float |
InClientRequestTime, |
|
|
float |
InServerCurrentTime |
|
) |
| |
[Time Sync Step3] Called from the server and execute in the client via RPC.
Sync client time with InServerCurrentTime + delay compendation.
Delay is estimated as 0.5 * (current client time - InClientRequestTime)
- Parameters
-
UFUNCTION(Client, Reliable)
◆ CreateROS2SimStateClient()
◆ GetLifetimeReplicatedProps()
void ARRNetworkPlayerController::GetLifetimeReplicatedProps |
( |
TArray< FLifetimeProperty > & |
OutLifetimeProps | ) |
const |
|
override |
Returns the properties used for network replication, this needs to be overridden by all actor classes with native.
replicated properties
- Parameters
-
OutLifetimeProps | Output lifetime properties |
◆ GetLocalTime()
virtual float ARRNetworkPlayerController::GetLocalTime |
( |
| ) |
|
|
inlinevirtual |
◆ OnRep_SimStateClient()
virtual void ARRNetworkPlayerController::OnRep_SimStateClient |
( |
| ) |
|
|
virtual |
◆ ReceivedPlayer()
virtual void ARRNetworkPlayerController::ReceivedPlayer |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ RequestServerTimeUpdate()
void ARRNetworkPlayerController::RequestServerTimeUpdate |
( |
| ) |
|
◆ ServerRequestLocalClockUpdate()
void ARRNetworkPlayerController::ServerRequestLocalClockUpdate |
( |
float |
InClientRequestTime | ) |
|
[Time Sync Step2] Called from the client and execute in the server via RPC.
Get current server time and call ClientSendLocalClockUpdate with current server time and given InClientRequestTime
- Parameters
-
InClientRequestTime | Client Time when client call this method. |
UFUNCTION(Server, Reliable)
◆ ServerSetAngularVel()
virtual void ARRNetworkPlayerController::ServerSetAngularVel |
( |
ARRBaseRobot * |
InServerRobot, |
|
|
float |
InClientTimeStamp, |
|
|
const FRotator & |
InClientRobotRotation, |
|
|
const FVector & |
InAngularVel |
|
) |
| |
|
virtual |
Set server angular velocity to #RobotVehicleMoveComponent. Non player object can use this method to call RPC.
- Parameters
-
InServerRobot | target server-owned robot |
InClientTimeStamp | |
InClientRobotRotation | |
InAngularVel | |
- Note
- This method is because RRBaseRobot can't use rpc since it is not controlled/possessed by the Player.
UFUNCTION(BlueprintCallable, Server, Reliable)
◆ ServerSetLinearVel()
virtual void ARRNetworkPlayerController::ServerSetLinearVel |
( |
ARRBaseRobot * |
InServerRobot, |
|
|
float |
InClientTimeStamp, |
|
|
const FTransform & |
InClientRobotTransform, |
|
|
const FVector & |
InLinearVel |
|
) |
| |
|
virtual |
Set server linear velocity to #RobotVehicleMoveComponent. Non player object can use this method to call RPC.
- Parameters
-
InServerRobot | target server-owned robot |
InClientTimeStamp | |
InClientRobotPosition | |
InLinearVel | |
- Note
- This method is because RRBaseRobot can't use rpc since it is not controlled/possessed by the Player.
UFUNCTION(BlueprintCallable, Server, Reliable)
◆ ServerSetPlayerName()
void ARRNetworkPlayerController::ServerSetPlayerName |
( |
const FString & |
InPlayerName | ) |
|
◆ Tick()
virtual void ARRNetworkPlayerController::Tick |
( |
float |
DeltaSeconds | ) |
|
|
overridevirtual |
◆ UpdateLocalClock()
void ARRNetworkPlayerController::UpdateLocalClock |
( |
float |
InDeltaSeconds | ) |
|
Increase local clock's time by delta seconds.
- Parameters
-
◆ ClockRequestTimerHandle
FTimerHandle ARRNetworkPlayerController::ClockRequestTimerHandle |
◆ LocalTime
float ARRNetworkPlayerController::LocalTime = 0.0f |
◆ PlayerName
FString ARRNetworkPlayerController::PlayerName |
◆ ROS2SimStateClient
◆ ServerSimState
◆ SimStateClientClockPublisher
◆ SimStateClientROS2Node
UROS2NodeComponent* ARRNetworkPlayerController::SimStateClientROS2Node = nullptr |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/rapyutasimulationplugins/checkouts/devel/Source/RapyutaSimulationPlugins/Public/Core/RRNetworkPlayerController.h