public void AddResponseToDiff(CommandResponseOp op, ViewDiff diff, CommandMetaData commandMetaData) { global::Improbable.Gdk.Core.Empty?rawResponse = null; if (op.StatusCode == StatusCode.Success) { rawResponse = global::Improbable.Gdk.Core.Empty.Serialization.Deserialize(op.Response.SchemaData.Value.GetObject()); } var internalRequestId = new InternalCommandRequestId(op.RequestId); var commandContext = commandMetaData.GetContext <global::Improbable.Gdk.Core.Empty>(ComponentId, 1, internalRequestId); commandMetaData.RemoveRequest(ComponentId, 1, internalRequestId); var response = new PlayerHeartbeat.ReceivedResponse( commandContext.SendingEntity, new EntityId(op.EntityId), op.Message, op.StatusCode, rawResponse, commandContext.Request, commandContext.Context, commandContext.RequestId); diff.AddCommandResponse(response, ComponentId, 1); }
public void RemoveMetaData(InternalCommandRequestId internalRequestId) { var requestId = internalRequestIdToRequestId[internalRequestId]; internalRequestIdToRequestId.Remove(internalRequestId); if (!idToCreateEntityRequest.Remove(requestId) && !idToDeleteEntityRequest.Remove(requestId) && !idToReserveEntityIdsRequest.Remove(requestId) && !idToEntityQueryRequest.Remove(requestId)) { throw new ArgumentException($"Can not remove non-existent command metadata for request ID {requestId}", nameof(internalRequestId)); } }
public void SetInternalRequestId(InternalCommandRequestId internalRequestId, CommandRequestId requestId) { internalRequestIdToRequestId.Add(internalRequestId, requestId); }