github.com/metaworking/channeld@v0.7.3/pkg/unrealpb/unreal_common.proto (about)

     1  syntax = "proto3";
     2  
     3  package unrealpb;
     4  
     5  import "google/protobuf/any.proto";
     6  
     7  option go_package = "github.com/metaworking/channeld/pkg/unrealpb";
     8  
     9  enum MessageType {
    10      INVALID = 0;
    11  
    12  	// Used by LowLevelSend() in NetConnection/NetDriver.
    13      LOW_LEVEL = 100;
    14  
    15  	// Used by ChanneldGameInstanceSubsystem to broadcast the ProtoMessageObject from server side. The message is packed as google::protobuf::any to support anonymous types.
    16      ANY = 101;
    17  
    18   	// Used by ChanneldNetDriver to send/receive UE's native RPC.
    19      // See @RemoteFunctionMessage
    20      RPC = 102;
    21  
    22      // Used by UE servers to spawn objects on the client. 
    23      // See @SpawnObjectMessage
    24      SPAWN = 103;
    25      
    26      // Used by UE servers to destroy objects on the client.
    27      // See @DestroyObjectMessage
    28      DESTROY = 104;
    29  
    30      // Used by the UE servers to sync the NetId of the static and well-known objects.
    31      SYNC_NET_ID = 107;
    32  
    33      // Deprecated
    34      SERVER_PLAYER_SPAWNED = 201;
    35  
    36      // Used by the Master server to broadcast the player leave (@UnsubscribedFromChannelResultMessage) to the spatial servers.
    37      SERVER_PLAYER_LEAVE = 202;
    38  }
    39  
    40  enum UnrealObjectType
    41  {
    42      UOT_Unknown = 0;
    43      UOT_GameState = 1;
    44      UOT_Actor = 2;
    45      UOT_Pawn = 3;
    46      UOT_Character = 4;
    47      UOT_PlayerState = 5;
    48      UOT_Controller = 6;
    49      UOT_PlayerController = 7;
    50  }
    51  
    52  // Maps to UE's FVector AND FRotator struct.
    53  // For FRotator, x = pitch, y = yaw, z = roll
    54  message FVector {
    55      optional float x = 1;
    56      optional float y = 2;
    57      optional float z = 3;
    58  }
    59  
    60  message UnrealObjectRef {
    61      optional uint32 netGUID = 1;
    62      message GuidCachedObject {
    63          uint32 netGUID = 1;
    64          string pathName = 2;
    65          uint32 outerGUID = 3;
    66      }
    67      repeated GuidCachedObject context = 2;
    68      optional bytes netGUIDBunch = 3;
    69      optional uint32 bunchBitsNum = 4;
    70      // optional uint32 objType = 5;
    71      optional string classPath = 6;
    72      optional uint32 owningConnId = 7;
    73  }
    74  
    75  message ActorComponentRef {
    76      optional UnrealObjectRef owner = 1;
    77      optional string compName = 2;
    78  }
    79  
    80  message AssetRef {
    81      string objectPath = 1;
    82  }
    83  
    84  message RemoteFunctionMessage {
    85      UnrealObjectRef targetObj = 1;
    86      string functionName = 2;
    87      bytes paramsPayload = 3;
    88      int32 redirectionCounter = 4;
    89      string subObjectPath = 5;
    90  }
    91  
    92  message SpawnObjectMessage {
    93      UnrealObjectRef obj = 1;
    94      optional uint32 channelId = 2;
    95      optional uint32 localRole = 3;
    96      // optional uint32 owningConnId = 4;
    97      // Only used by the spatial channel
    98      optional FVector location = 5;
    99  }
   100  
   101  message DestroyObjectMessage {
   102      uint32 netId = 1;
   103      uint32 reason = 2;
   104  }
   105  
   106  message HandoverContext {
   107      UnrealObjectRef obj = 1;
   108      // The client that owns the object. Only set for Pawns and PlayerControllers.
   109      optional uint32 clientConnId = 2;
   110  }
   111  
   112  // Wrapped in ChannelDataHandoverMessage.data
   113  // Implements [channeld.HandoverDataPayload]
   114  message HandoverData {
   115      repeated HandoverContext context = 1;
   116      // The channel data message that will be handed over to the destination channel.
   117      optional google.protobuf.Any channelData = 2;
   118  }
   119  
   120  message GetUnrealObjectRefMessage {
   121      repeated uint32 netGUID = 1;
   122  }
   123  
   124  message GetUnrealObjectRefResultMessage {
   125      repeated UnrealObjectRef objRef = 1;
   126  }
   127  
   128  message SyncNetIdMessage {
   129      message NetIdPath {
   130          uint32 netId = 1;
   131          string path = 2;
   132          optional uint32 outerNetId = 3;
   133      }
   134      repeated NetIdPath netIdPaths = 1;
   135  }
   136  
   137  message SpatialEntityState {
   138      UnrealObjectRef objRef = 1;
   139      bool removed = 2;
   140      // Full entity channel data. For cross-server handover only.
   141      optional google.protobuf.Any entityData = 3;
   142  }
   143  
   144  message SpatialChannelData {
   145      map<uint32, SpatialEntityState> entities = 1;
   146  }
   147  
   148  
   149  
   150  message FRepMovement {
   151      optional FVector linearVelocity = 1;
   152      optional FVector angularVelocity = 2;
   153      optional FVector location = 3;
   154      optional FVector rotation = 4;
   155      optional bool bSimulatedPhysicSleep = 5;
   156      optional bool bRepPhysics = 6;
   157  }
   158  
   159  message FRepAttachment {
   160      optional UnrealObjectRef attachParent = 1;
   161      optional FVector locationOffset = 2;
   162      optional FVector relativeScale = 3;
   163      optional FVector rotationOffset = 4;
   164      optional string attachSocket = 5;
   165      optional ActorComponentRef attachComponent = 6;
   166  }
   167  
   168  message ActorState {
   169      bool removed = 1;
   170      optional uint32 owningConnId = 2;
   171      optional bool bReplicateMovement = 3;
   172      optional uint32 localRole = 4;
   173      optional uint32 remoteRole = 5;
   174      optional UnrealObjectRef owner = 6;
   175      optional bool bHidden = 7;
   176      optional bool bTearOff = 8;
   177      optional bool bCanBeDamaged = 9;
   178      optional UnrealObjectRef instigator = 10;
   179      optional FRepMovement replicatedMovement = 11;
   180      optional FRepAttachment attachmentReplication = 12;
   181  }
   182  
   183  message ActorComponentState {
   184      // Marks that the state should be removed from the containing map
   185      bool removed = 1;
   186      optional bool bIsActive = 2;
   187      optional bool bReplicated = 3;
   188      optional string compName = 4;
   189  }
   190  
   191  message ActorComponentStates {
   192      map<string, ActorComponentState> states = 1;
   193  }
   194  
   195  message SceneComponentState {
   196      bool removed = 1;
   197      optional bool bAbsoluteLocation = 2;
   198      optional bool bAbsoluteRotation = 3;
   199      optional bool bAbsoluteScale = 4;
   200      optional bool bVisible = 5;
   201      optional bool bShouldBeAttached = 6;
   202      optional bool bShouldSnapLocationWhenAttached = 7;
   203      optional bool bShouldSnapRotationWhenAttached = 8;
   204      optional ActorComponentRef attachParent = 9;
   205      repeated ActorComponentRef attachChildren = 10;
   206      optional string attachSocketName = 11;
   207      optional FVector relativeLocation = 12;
   208      optional FVector relativeRotation = 13;
   209      optional FVector relativeScale = 14;
   210  }
   211  
   212  message FBasedMovementInfo {
   213      optional ActorComponentRef movementBase = 1;
   214      optional string boneName = 2;
   215      optional FVector location = 3;
   216      optional FVector rotation = 4;
   217      optional bool bServerHasBaseComponent = 5;
   218      optional bool bRelativeRotation = 6;
   219      optional bool bServerHasVelocity = 7;
   220  }
   221  
   222  message FRootMotionSource {
   223      optional uint32 priority = 1;
   224      optional uint32 localId = 2;
   225      optional uint32 accumulatedMode = 3;
   226      optional string instanceName = 4;
   227      optional float startTime = 5;
   228      optional float currentTime = 6;
   229      optional float previousTime = 7;
   230      optional float duration = 8;
   231      optional uint32 status = 9;
   232      optional uint32 settings = 10;
   233      optional bool bInLocalSpace = 11;
   234      optional bool bNeedsSimulatedCatchup = 12;
   235      optional bool bSimulatedNeedsSmoothing = 13;
   236      optional bool bHasRootMotion = 14;
   237      optional float blendWeight = 15;
   238      message FRootMotionFinishVelocitySettings {
   239          optional uint32 mode = 1;
   240          optional FVector setVelocity = 2;
   241          optional float clampVelocity = 3;
   242      }
   243      optional FRootMotionFinishVelocitySettings finishVelocityParams = 16;
   244  }
   245  
   246  message FRootMotionSourceGroup {
   247      repeated FRootMotionSource rootMotionSources = 1;
   248      repeated FRootMotionSource pendingAddRootMotionSources = 2;
   249      optional bool bHasAdditiveSources = 3;
   250      optional bool bHasOverrideSources = 4;
   251      optional bool bHasOverrideSourcesWithIgnoreZAccumulate = 5;
   252      optional bool bIsAdditiveVelocityApplied = 6;
   253      optional uint32 lastAccumulatedSettings = 7;
   254      optional FVector lastPreAdditiveVelocity = 8;
   255  }
   256  
   257  message FRepRootMotionMontage {
   258      optional bool bIsActive = 1;
   259      optional UnrealObjectRef animMontage = 2;
   260      optional float position = 3;
   261      optional FVector location = 4;
   262      optional FVector rotation = 5;
   263      optional ActorComponentRef movementBase = 6;
   264      optional string movementBaseBoneName = 7;
   265      optional bool bRelativePosition = 8;
   266      optional bool bRelativeRotation = 9;
   267      optional FRootMotionSourceGroup authoritativeRootMotion = 10;
   268      optional FVector acceleration = 11;
   269      optional FVector linearVelocity = 12;
   270  }
   271  
   272  message CharacterState {
   273      optional FRepRootMotionMontage rootMotion = 2;
   274      optional FBasedMovementInfo basedMovement = 3;
   275      optional float serverLastTransformUpdateTimeStamp = 4;
   276      optional uint32 movementMode = 5;
   277      optional bool bIsCrouched = 6;
   278      optional bool bProxyIsJumpForceApplied = 7;
   279      optional float animRootMotionTranslationScale = 8;
   280      optional float replayLastTransformUpdateTimeStamp = 9;
   281  }
   282  
   283  message Character_ServerMovePacked_Params {
   284      uint32 bitsNum = 1;
   285      bytes packedBits = 2;
   286  }
   287  
   288  message Character_ClientMoveResponsePacked_Params {
   289      uint32 bitsNum = 1;
   290      bytes packedBits = 2;
   291  }
   292  
   293  message PlayerState {
   294      optional float score = 2;
   295      optional int32 playerId = 3;
   296      optional uint32 ping = 4;
   297      optional string playerName = 5;
   298  }
   299  
   300  message ControllerState {
   301      // APlayerState is an actor.
   302      UnrealObjectRef playerState = 2;
   303      UnrealObjectRef pawn = 3;
   304  }
   305  
   306  message Controller_ClientSetLocation_Params {
   307      FVector newLocation = 1;
   308      FVector newRotation = 2;
   309  }
   310  
   311  message Controller_ClientSetRotation_Params {
   312      FVector newRotation = 1;
   313      bool bResetCamera = 2;
   314  }
   315  
   316  message PlayerControllerState {
   317      optional FVector targetViewRotation = 2;
   318      optional FVector spawnLocation = 3;
   319  }
   320  
   321  message PlayerController_ServerUpdateCamera_Params {
   322      FVector camLoc = 1;
   323      int32 camPitchAndYaw = 2;
   324  }
   325  
   326  message PlayerController_ClientSetHUD_Params {
   327      optional string hudClassName = 1;
   328  }
   329  
   330  message PlayerController_ClientSetViewTarget_Params {
   331      UnrealObjectRef actor = 1;
   332      float blendTime = 2;
   333      uint32 blendFunction = 3;
   334      float blendExp = 4;
   335      bool bLockOutgoing = 5;
   336  }
   337  
   338  message PlayerController_ClientEnableNetworkVoice_Params {
   339      optional bool bEnable = 1;
   340  }
   341  
   342  message PlayerController_ClientCapBandwidth_Params {
   343      int32 cap = 1;
   344  }
   345  
   346  message PlayerController_ClientRestart_Params {
   347      UnrealObjectRef pawn = 1;
   348  }
   349  
   350  message PlayerController_ClientSetCameraMode_Params {
   351      string newCamMode = 1;
   352  }
   353  
   354  message PlayerController_ClientRetryClientRestart_Params {
   355      UnrealObjectRef pawn = 1;
   356  }
   357  
   358  message PlayerController_ServerSetSpectatorLocation_Params {
   359      FVector newLoc = 1;
   360      FVector newRot = 2;
   361  }
   362  
   363  message PlayerController_ServerAcknowledgePossession_Params {
   364      UnrealObjectRef pawn = 1;
   365  }
   366  
   367  message PlayerController_ClientGotoState_Params {
   368      string newState = 1;
   369  }
   370  
   371  message PlayerController_ClientReceiveLocalizedMessage_Params {
   372      string message = 1;
   373      int32 switch = 2;
   374      UnrealObjectRef relatedPlayerState_1 = 3;
   375      UnrealObjectRef relatedPlayerState_2 = 4;
   376      UnrealObjectRef optionalObject = 5;
   377  }
   378  
   379  message GameStateBase {
   380      optional string spectatorClassName = 2;
   381      optional string gameModeClassName = 3;
   382      // Compatible with UE 5.2+
   383      optional double replicatedWorldTimeSeconds = 4;
   384      optional bool bReplicatedHasBegunPlay = 5;
   385  }
   386  
   387  message PawnState {
   388      UnrealObjectRef playerState = 1;
   389      UnrealObjectRef controller = 2;
   390      optional uint32 remoteViewPitch = 3;
   391  }
   392  
   393  // For customized FCharacterMoveResponseDataContainer::Serialize
   394  message FClientAdjustment {
   395      optional bool bAckGoodMove = 1;
   396      optional float timeStamp = 2;
   397      optional FVector newLoc = 3;
   398      optional FVector newVel = 4;
   399      optional FVector newRot = 5;
   400      optional UnrealObjectRef newBase = 6;
   401      optional string newBaseBoneName = 7;
   402      optional bool bBaseRelativePosition = 8;
   403      optional FRootMotionSourceGroup rootMotionSourceCorrection = 9;
   404      optional FVector rootMotionRotation = 10;
   405      optional uint32 movementMode = 11;
   406  }
   407  
   408  message StaticMeshComponentState {
   409      bool removed = 1;
   410      AssetRef staticMesh = 2;
   411  }