-- Replica data changes:

rev_ReplicaSetValue.OnClientEvent:Connect(ReplicaSetValue) -- (replica_id, {path}, value)

rev_ReplicaSetValues.OnClientEvent:Connect(ReplicaSetValues) -- (replica_id, {path}, {values})

rev_ReplicaArrayInsert.OnClientEvent:Connect(ReplicaArrayInsert) -- (replica_id, {path}, value)

rev_ReplicaArraySet.OnClientEvent:Connect(ReplicaArraySet) -- (replica_id, {path}, index, value)

rev_ReplicaArrayRemove.OnClientEvent:Connect(ReplicaArrayRemove) -- (replica_id, {path}, index)

rev_ReplicaWrite.OnClientEvent:Connect(function(replica_id, func_id, ...) -- (replica_id, func_id, {params})
	local replica = Replicas[replica_id]
	-- Running function:
	WriteFunctionFlag = true
	replica._write_lib[func_id](replica, ...)
	WriteFunctionFlag = false
	-- Signaling listeners:
	local listeners = replica._function_listeners[func_id]
	if listeners ~= nil then
		for _, listener in ipairs(listeners) do
			listener(...)
		end
	end
end)
