AGameMode
Règles de jeu
Server only # client return null
e.g. N playersAGameState
Données de la game
Autorité serveur
Repliqué client
e.g. team scoreAPlayerState
Données d'un player
Autorité serveur
Repliqué clients
e.g. K/DAPlayerController
Contrôle un player
Autorité serveur
Repliqué sur le owning client
e.g. LifeAPawn / ACharacter
Représentation Player
Autorité serveur
Repliqué aux clients
e.g. MeshAHud- Dedicate server
- Listen server 服务器为客户之一
- Server
Owning Client -> Server- Server / Drop
- Client
Server -> Owning Client- Owning Client / Server
- Multicast
Server -> All Clients- Server + Clients
- Reliable
- Unreliable
if the parameters are correct. anti-cheat. etc.
Varaibles classes herite d'Actor
Type Variable : NetSerializable
UPROPERTY(Replicated) // 服务器修改自动扩散GetLifetimeReplicatedProps // 应当被重载(?)
bReplicates = true;OnRepNotify() {} // 修改后自动执行
UPROPERTY(ReplicatedUsing = FUNCTION) // Don't execute on serverServer own TOUT, sauf :
PawnPlayerController
Actor
Collider
Component
Line Sweep
Interface
Customisation BPAdd C++ plugin. Plngin should be put in a git, then there is a plugin insert it into Unreal.
InteractFramework
File named *.Build.cs can add dependencies:
PublicDependcyModuleNames.AddRange(
new String[] {
"Core",
"AIModule",
// dependcies
}
);class SomeClass: public OtherClass
{
void SomeClass::StartupModule() {}
void SomeClass::ShutdownModule() {}
// 不要乱动……
}UINTERFACE()
class UIFInterface: public UInterface {
GENERATED_BODY()
}; // no touche pas
class INTERACTFRAMEWORK_API IIFInteractable : public AActor : public Interactable
{
GENERATED_BODY()
public:
virtual void Interact(AActor* Interactor) = 0;
UPROPERTY(EditAnywhere, Blueprintxxx)
class Trigger* XXX;
}
AIFInteractibleActor::AIFInteractibleActor() {
PrimaryActorTick.bCanEverTick = false;
Trigger = CreateDefaultSubobject<USphereComponent>(TEXT("Trigger"));
RootComponent = Trigger;
Trigger->SetCollisionProfileName(TEXT("Trigger"));
Trigger->SetGenerateOverlapEvents(true);
}
void AIFInteractiableActor::BeginPlay() {
Super::BeginPlay();
Trigger->OnComponenetOverlap.AddDynamic(this, ...)
}
void AIFInteractiableActor::HandleOverlapEvent(...) {
if (OtherActor == nullptr) return;
auto* xxx = Cast<UIFInteractiableActor>(Src::OtherActor->SetComponent...);
}UFUNCTION(Blueprintxxx) // create an event in blueprint
BP_Interact(Interactor);void UIFInteractorComponent::Interact()
{
if (!GetOwner()->HasAuthority()) {
Server_Interact();
return;
}
XXX();
}